Cannot escape * in bolditalic markdown
-
Markdown:
***\*twitch\****
Expected output:
*twitch*Actual output:
*twitch*what?
-
Golfed example:
***\****
*
-
Oh, that's just Feature #3897389: The Very Spoiler tag.
-
***\ ***\* ***\** ***\*** ***\**** **\**** *\**** \****
gives
***
*
*
*
*
*
*
*Edit: Fixed image yay
-
image broken to me.
but yeah. it's weird as heck isn't it?
-
***\*Discourse***
*Discourse
I cannot figure out why
\*
yields a hashcode... or why it should...
-
3389dae361af79b04c9c8e7057f60cc6 MD5 : *
Sooo, it converts the asterisk... to MD5 of an asterisk...
-
***\T***
\TSo it doesn't do it with anything other than
***\****
...
The odd thing is, it wipes out everything that follows too, unless you leave a single blank line; stuff after that renders fine.
-
o_Ô
-
https://meta.discourse.org/t/cannot-escape-in-bolditalic-markdown/22280/1
Reported on Meta.d
-
\blah*blahtest
\blah*blahtest
Well THAT's interesting. It removes things only after the closing asterisks.
-
*******
So the
\
is required; without it you get anhr
tag.
-
var endText = new RegExp("[^\\s|" + match[0] + "]" + match.replace(/\*/g,"\\*") + "([^" + match[0] + "]|$)");
So first it replaces
*
with\\*
...text = text.replace(new RegExp("\\\\\\" + match[0], "g"), hash);
...then replaces
\\\(match)
with the hash of the matched content; except it apparently appends*
to the regexp, which gobbles up everything, and I'm not looking at the madness within further, but it probably includes the ending asterisks....var finish = text.split("\n")[0].search(endText); if(finish && finish >= 0) { var newText = text.substring(match.length, finish+1); newText = this.processInline(newText); var array = typeof tag === "string" ? [tag].concat(newText) : [tag[0], [tag[1]].concat(newText)]; if (array && array.length > 1) { var last = (array.length - 1); if (typeof array[last] === "string") { array[last] = array[last].replace(new RegExp(hash, "g"), match[0]); } } return [finish + match.length + 1, array]; }
...and, I'm guessing wildly here, looks for the text in the output, doesn't find it, and promptly skips the rest of the function.
Seems like a hack (replacing an unusual sequence with a hash to re-replace it later) gone wrong.
(also, gotta love that "letters" table...)
-
Just wondering... *test @sockbot
-
http://what.thedailywtf.com/raw/4993/14
huh.... clever... doesn't seem to have worked... @Zoidberg
* @sockbot
-
What? My mother was a saint! Get out!
-
(also, gotta love that "letters" table...)
Can't fault them much for that one tbqh,
[A-z]
catches only the English alphabet AFAIK.Then again, the parser never should have been done with regexes in the first place.
-
I pointed out a similar bug hours ago
http://what.thedailywtf.com/t/literally-wtf/4984
Great, the info box is broken for this as well.
-
Great, the info box is broken for this as well.
Bog standard 'strip random bits of the formatting unless the onebox is expanded' complaint. NOTABUG.
-
I even think you've mentioned this to me before :S
-
wh*at
-
* @accalia checking to see whether or not mentions work in here.
-
No, it eats whatever's inside. In some other thread a while ago, I had to pad the thing with characters to get it to put a link after the MD5 string.
-
Something cool about accalia's bots. I summoned translator, and it could read the text the MD5 covered. I don't even know anymore.
-
Something cool about accalia's bots. I summoned translator, and it could read the text the MD5 covered. I don't even know anymore.
They see the raw post content
-
Something cool about accalia's bots. I summoned translator, and it could read the text the MD5 covered. I don't even know anymore.
as @RaceProUK said the bots look at the raw post, do some cleanup (removing BBcode style quotes) and call the result the "cleaned" post. then they operate off of that. hide your commands however you want. if they're in raw the bots see.
-
if they're in raw the bots see.
@sockbot needs a line spoofing that one from The Exorcist (I think it is). Y'know, the 'I see dead people' line, but about raw posts or something.Or maybe it could have a line about foxes or something.
Or both. Up to you ;)
-
@RaceProUK has summoned me, and so I appear.
-
i really need to add those extra phrases to sockbot....
mind bumping that thread in bot testing about it so i remember?
-
Yep, @anonymous234's post got deleted at meta. Jeff's response:
https://meta.discourse.org/t/cannot-escape-in-bolditalic-markdown/22280/8?u=boomzilla
-
i make a jab at the tree over there.
wonder what will happen to that post? ;-)
-
i make a jab at the tree over there.
wonder what will happen to that post? ;-)
He replied to itIn typical Jeff style, he dismisses an issue that eats users' posts as WONTFIX - WORKAROUND.
-
well that was fast...
i'll agree to the low priority of the bug.
still confused as hades as to how md5 hashing anything makes sense in markdown parsing...
-
still confused as hades as to how
md5 hashinganything makes sense in markdown parsing...Been here long?
-
-
No longer surprised by any stupid ideas they have, like replacing parts of the content during parsing instead of using a proper separate context stack and output buffer.
CompletelyRewrittenTFY.
-
Something cool about accalia's bots. I summoned translator, and it could read the text the MD5 covered. I don't even know anymore.
In the database there are two versions of every post,
raw
andcooked
. The bots look at raw, @mentions et alia I presume are looking at cooked.discourse=# \x Expanded display is on. discourse=# select * from posts where id=174958; -[ RECORD 1 ]-----------+------------------------------------------------------------------------------------------------------------------------------------------ id | 174958 user_id | 1263 topic_id | 4993 post_number | 24 raw | Something cool about accalia's bots. I summoned translator, and it could read the text the MD5 covered. I don't even know anymore. cooked | <p>Something cool about accalia's bots. I summoned translator, and it could read the text the MD5 covered. I don't even know anymore.</p> created_at | 2014-12-16 20:31:29.172499 updated_at | 2014-12-16 20:31:29.172499 reply_to_post_number | 23 reply_count | 2 quote_count | 0 deleted_at | off_topic_count | 0 like_count | 2 incoming_link_count | 0 bookmark_count | 0 avg_time | 34 score | 47.7 reads | 30 post_type | 1 vote_count | 0 sort_order | 24 last_editor_id | 1263 hidden | f hidden_reason_id | notify_moderators_count | 0 spam_count | 0 illegal_count | 0 inappropriate_count | 0 last_version_at | 2014-12-16 20:31:29.184578 user_deleted | f reply_to_user_id | 681 percent_rank | 0.264705882352941 notify_user_count | 0 like_score | 2 deleted_by_id | edit_reason | word_count | 24 version | 1 cook_method | 1 wiki | f baked_at | 2014-12-16 20:31:29.172166 baked_version | 1 hidden_at | self_edits | 0 reply_quoted | f via_email | f raw_email | public_version | 1 discourse=#
Don't ask me what 90% of those fields are nor how some of them are calculated. I have no idea.
-
And for the hidden @mentions:
discourse=# \x Expanded display is on. discourse=# SELECT id, raw, cooked FROM posts WHERE cooked LIKE '%3389dae361af79b04c9c8e7057f60cc6%' AND raw LIKE '%@%' AND cooked NOT LIKE '%@%'; -[ RECORD 1 ]------------------------------------------------------------------------------------------------------------------- id | 174945 raw | ***\**** @accalia checking to see whether or not mentions work in here. cooked | <p><strong><em>3389dae361af79b04c9c8e7057f60cc6</em></strong> checking to see whether or not mentions work in here.</p> -[ RECORD 2 ]------------------------------------------------------------------------------------------------------------------- id | 154757 raw | Just wondering... ***\*test*** @sockbot cooked | <p>Just wondering... <strong><em>3389dae361af79b04c9c8e7057f60cc6test</em></strong></p> discourse=#
http://what.thedailywtf.com/p/174945
http://what.thedailywtf.com/p/154757
-
https://meta.discourse.org/t/cannot-escape-in-bolditalic-markdown/22280/11
well then. i go t a present from @sam!
thanks @sam!
-
And a visit from Mr. Grinch.
Filed under: More lines of code is not bad if it improves clarity, we need a new tag cloud to attack
-
Body is * some padding characters here ; try to be a little more descriptive
-
well yes.
maybe this year we'll have a miracle and his heart will grow three sizes....
-
Only if he gets congestive heart failure.
-
-
so we did get that update applied.....
*twitch*
nice.
-
-
DONT'
TEMPT
MURPHY!
<just don't>