4

I just tried to edit a question on SO, and had the following Markdown:

> [a bunch of text] ...service of remote systems.

> The following XML document shows an example of an XXE attack.

>     <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE foo [
    <!ELEMENT foo ANY >
    <!ENTITY xxe SYSTEM "file:///dev/random" >]><foo>&xxe;</foo>

> This example could... [a bunch more text]

This produced a red JS pop-out box containing the following message:

Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. For more editing help, click the [?] toolbar icon.

I added blockquote Markdown to the entire code block instead of just the first line, like so

> [a bunch of text] ...service of remote systems.

> The following XML document shows an example of an XXE attack.

>     <?xml version="1.0" encoding="ISO-8859-1"?>
>     <!DOCTYPE foo [
>     <!ELEMENT foo ANY >
>     <!ENTITY xxe SYSTEM "file:///dev/random" >]><foo>&xxe;</foo>

> This example could... [a bunch more text]

and the error went away (see version 3 of the question's history).

However, both versions of the Markdown resulted in correctly baked/rendered HTML, at least in the editor preview (I couldn't test on the live site because the error prevented edit submission). I was able to repro here, in the Meta Stack Exchange formatting sandbox, as Sonic suggested.

Could you please update the trigger for that error to not display the message or block the edit in cases like this?

You must log in to answer this question.

Browse other questions tagged .