What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

When you visit a page on SO other than the homepage (like 'Questions' or 'Unanswered' for example) there is some preview text shown below each question. (looks like the first X number of characters / words from the post body is displayed).

If a user includes some markdown formatting in the beginning of their question, how does SO avoid showing this in the question preview? For example if I were to type a link or an embedded code block, You don't see the markdown syntax [link](link) in the preview.

share|improve this question
    
How do you mean "how"? Like, which code is used in their backend? –  slhck Sep 14 '11 at 19:08
    
Yes, I guess i'm wondering how they transform the body of the post (which I assume is saved 'as-is' with the markdown syntax included) so that you don't see processed markdown in the question previews, such as a code block being cut in half or things like [link](link) appearing –  Brian Glaz Sep 14 '11 at 19:18
    
Well, whatever facility there is – I'm not too sure they'll just send you the code :) –  slhck Sep 14 '11 at 19:20
    
I think this question should be in stackoverflow if you want to get exact code. there are plenty of ways to do that. there are several ready made scripts that can preview text without the tags. it's matter of converting on the fly in javascript in case of stackoverflow preview. –  Dreaded semicolon Sep 15 '11 at 3:01
    
@Dreaded semicolon Do you have a link to any of these scripts? I'm not looking to convert it on the fly. I just want to take some text stored in my DB, not process it with markdown, but remove markdown formatting –  Brian Glaz Sep 15 '11 at 3:23
    
Then it's a question for Stack Overflow. –  slhck Sep 15 '11 at 7:28

1 Answer 1

How do you think they avoid showing the markdown when you view the full "rich text" post? Parsing and output are independent, and even if they weren't the primary output (the HTML-formatted post) could be reparsed and output as plain text.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .