Ask Your Question

text between angle brackets is silently dropped (in preview)

asked 2010-09-04 05:11:55 -0600

niles gravatar image

updated 2010-09-04 06:45:25 -0600

>>> L = [1,2,3]
>>> type(L)
<type 'list'="">

should read:

>>> L = [1,2,3]
>>> type(L)
<type 'list'>

EDIT: Oh, they don't get dropped from the posted question, only from the preview! <even here?="">

EDIT 2: the above should be <even here?>

It seems that angle brackets are ignored, together with everything between them, probably for html reasons. Using "& lt ;" etc. of course fixes this, so <this doesn't get dropped>, but this could be a problem when pasting code snippets, as above.

What to do about this? Maybe just let people post confusing code snippets until they figure out they need to modify them . . . or maybe toss up a warning flag when angle brackets are detected? Come to think of it, putting up a flag when any kind of special markup is detected might be useful for new users who are unaware of it. Then people trying to post a question involving subscripts wouldn't inadvertently be italicizing part of their question. (e.g. the first line of this question from asksage)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2010-09-04 14:25:03 -0600

Evgeny gravatar image

updated 2010-09-04 15:08:42 -0600

Looks like there are inconsistencies between the markdown renderers in previewer (and maybe errors within), there isn't an easy fix I'm afraid, b/c only extensive testing can validate a parser well.

What you suggest - giving a warning on use of special characters - might work actually and can be done.

The workaround is to use backticks around the inlined literals or four leading spaces on each literal line. That's the official markdown for the snippets of code.

You can also select the text you want to post as a literal snippet and then hit the "preformatted text" button (the one with one's and zeroes) or a combination of keys Ctrl-K.

The reason things with angle brackets "disappear" is that markdown does allow HTML tags, however markdown parsers do not perform full input validation and do not give warnings on edge cases.

I will put out better tooltip help for markdown - looks like people need better heddukation - and try to add an alert like you've suggested.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2010-09-04 05:11:55 -0600

Seen: 851 times

Last updated: Sep 04 '10