Cannot escape * in bolditalic markdown

markdown

(Apparently Archetype) #1

Markdown:

***\*twitch\****

Expected output:
*twitch*

Actual output:
*twitch*

Golfed example:

***\****

*

Edit: additional information:

this line ***\**** is incomplete

this line * is incomplete


#2

It’s so broken it’s almost beautiful.

For the record:

new RegExp("\\\\\\" + match[0], "g")

= bad idea, if your match[0] is *. Though judging by the fact that it works only for asterisks, I assume it’s mishandling **** by matching the first three somewhere, and the last three somewhere else. I can’t for the love of deities figure out that code, though.


#3

Here’s a similar asterisk issue, but I don’t know if the fix will be related.

Raw:

[quote="JazzyJosh, post:29, topic:4963"]
Come on now, using *\*Markdown isn't that hard\** You have to escape both of the inner asterisks.
[/quote]

Apparently I have to keep typing because post must be at least 20 characters.


#4

Raw:
TRWTF is that it *\*doesn't\** chop off the rest of the line but rather only some random amount of characters.


#6

This thing is sitting in limbo. Meanwhile, Discourse eats the text of users’ posts.

What’s the deal, guys?


(Jeff Atwood) #8

The workaround is to use HTML tags if you need an asterisk inside bold and italic.


(Apparently Archetype) #9

So i take it that this means this markdown parsing bug is being resolved as WONTFIX then?

that does not seem right.


(Jeff Atwood) #10

No, it’s just low priority because it’s very obscure and there is a workaround.

*twitch*
<b><i>\*twitch\*</i></b>

*twitch*
[b][i]\*twitch\*[/i][/b]

*twitch*
__*\*twitch\**__

Take your pick.


(Sam Saffron) #11

Merry Christmas

https://github.com/discourse/discourse/commit/e23e008682d3bf962ff2f64f0dbcfae46122b4b7

Also cc @eviltrout


(Sam Saffron) #12