Please fix the XML pre tags
-
Whenever you insert XML into a Q&A answer, it removes all capitalization. Since you don't have an XAML language type, using <pre lang="xml"> removes all the capitalization inside the tags. This is a problem when posting answers about xml configuration files since the attributes inside an xml tag is case-sensitive. It doesn't allow the user to copy/paste XML/XAML from an answer into code. See Convert this XAML in Code[^], I had posted the answer with XAML that has capitalized tags and attributes, but when submitting it turns it all lower case. [Edit] The preview at the bottom shows the code block is correct, with the proper capitalization, but after submitting the capitalization is removed. Choosing to "Improve Answer" shows that the text inside the edit box has the capitalization removed so something after submitting is transforming the text to lower case.
-
Whenever you insert XML into a Q&A answer, it removes all capitalization. Since you don't have an XAML language type, using <pre lang="xml"> removes all the capitalization inside the tags. This is a problem when posting answers about xml configuration files since the attributes inside an xml tag is case-sensitive. It doesn't allow the user to copy/paste XML/XAML from an answer into code. See Convert this XAML in Code[^], I had posted the answer with XAML that has capitalized tags and attributes, but when submitting it turns it all lower case. [Edit] The preview at the bottom shows the code block is correct, with the proper capitalization, but after submitting the capitalization is removed. Choosing to "Improve Answer" shows that the text inside the edit box has the capitalization removed so something after submitting is transforming the text to lower case.
Ron Beyer wrote:
removes all the capitalization inside the tags.
Let's try that:
<pre lang="xml">
<CapitalizedTag>Value</CapitalizedTag>
</pre>Result:
<CapitalizedTag>Value</CapitalizedTag>
Strange, it doesn't remove the capitalization (perhaps because this is a message and not an answer). EDIT: I found the reason!!! Probably, you wrote something like this:
<pre lang="xml">
<CapitalizedTagHere>Value</CapitalizedTagHere>
</pre>This will result in this (only in answers, in messages it gives a proper result):
<capitalizedtaghere>Value</capitalizedtaghere>
You need to change the
<
and>
into the HTML entities<
and>
because otherwise, when posting an answer, the server thinks that your tags are real HTML tags, and removed the capitalization, but when rendering them, they are not real HTMl tags, so it will render the lowercase HTML tags as text. So that's why you need to use the HTML entities also in code blocks.The quick red ProgramFOX jumps right over the
Lazy<Dog>
. My latest article: Create an HTML5 (and JavaScript) Maze Game with a timer My group: C# Programmers Group -
Ron Beyer wrote:
removes all the capitalization inside the tags.
Let's try that:
<pre lang="xml">
<CapitalizedTag>Value</CapitalizedTag>
</pre>Result:
<CapitalizedTag>Value</CapitalizedTag>
Strange, it doesn't remove the capitalization (perhaps because this is a message and not an answer). EDIT: I found the reason!!! Probably, you wrote something like this:
<pre lang="xml">
<CapitalizedTagHere>Value</CapitalizedTagHere>
</pre>This will result in this (only in answers, in messages it gives a proper result):
<capitalizedtaghere>Value</capitalizedtaghere>
You need to change the
<
and>
into the HTML entities<
and>
because otherwise, when posting an answer, the server thinks that your tags are real HTML tags, and removed the capitalization, but when rendering them, they are not real HTMl tags, so it will render the lowercase HTML tags as text. So that's why you need to use the HTML entities also in code blocks.The quick red ProgramFOX jumps right over the
Lazy<Dog>
. My latest article: Create an HTML5 (and JavaScript) Maze Game with a timer My group: C# Programmers GroupSo why does it correctly render in the preview, but get mangled after submit? Shouldn't the system change everything between the pre tags into HTML-compatible stuff? I can only imagine what kind of giant PITA it would be to go through a 25+ line XML/XAML file and change every < > into its html escape code. I thought that was the purpose of pre tags?
-
So why does it correctly render in the preview, but get mangled after submit? Shouldn't the system change everything between the pre tags into HTML-compatible stuff? I can only imagine what kind of giant PITA it would be to go through a 25+ line XML/XAML file and change every < > into its html escape code. I thought that was the purpose of pre tags?
Ron Beyer wrote:
So why does it correctly render in the preview, but get mangled after submit?
I don't know the internals of the Preview feature, so I actually have no idea.
Ron Beyer wrote:
I can only imagine what kind of giant PITA it would be to go through a 25+ line XML/XAML file and change every < > into its html escape code
To avoid that, just choose "Encode HTML" when pasting your code, then it will automatically change
<
and>
into its HTML entity.The quick red ProgramFOX jumps right over the
Lazy<Dog>
. My latest article: Create an HTML5 (and JavaScript) Maze Game with a timer My group: C# Programmers Group