Bitbucket

Owen Campbell's Avatar

Owen Campbell

07 Nov, 2013 11:38 AM

I'm using Marked with Sublime Text to edit a wiki on Bitbucket.

It's mostly working fine, but I've hit a syntax problem:

Bitbucket do not allow HTML within the wiki pages. That means I can use text within angled brackets and it will be displayed as expected because Bitbucket will not interpret it as an HTML tag.

Is there a way to do the same in Marked? At the moment, anything within a pair of angled brackets is not displayed (I assume Marked treats it as HTML). If I use an escape character, Marked shows my text, but Bitbucket shows the escape character too!!

  1. Support Staff 1 Posted by Brett on 07 Nov, 2013 02:02 PM

    Brett's Avatar

    In Markdown, angle brackets have the specific purpose of turning a raw
    URL into a self-linked URL. If the contents aren't recognized as a URL,
    they're treated as XML. There's no real way around this. Perhaps a
    custom preprocessor that went ahead and escaped the brackets to < and
    >, but it would require a custom script on your end.

  2. 2 Posted by Owen Campbell on 08 Nov, 2013 11:50 AM

    Owen Campbell's Avatar

    For anyone else who finds their way to this thread, the solution (as Brett suggested) is a simple pre-processor based on sed:

    Path: /usr/bin/sed (or whatever is the path to the sed executable on your system)
    Args: -e s/</\&lt;/g -e s/>/\&gt;/g

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac