2

I have asked a question on StackOverflow, which has a snippet of xml code, where a web link also exists (url tag).

pom.xml code snippet

Nonetheless, the formatter didn't mark correctly this specific tag, as it mismatched the url with a comment, because of the //.

Would this be a bug on the editor or did I do something wrong?

Keeping the language tag in the same indentation level produces the following output: enter image description here

,whereas placing it in the default indentation level, doesn't even display the code block.

1 Answer 1

5

The language prettifier/synatx highlighting uses the lang-java highlighter for all code-blocks due to the used java tag (scroll to the end).

If you want one code-block to use different high-lighting use the explicit prettify hint notation in just before your code-block:

<!-- language: lang-xml -->   
<repositories>
    <repository>
        <id>europa</id>
        <url>https://joinup.ec.europa.eu/nexus/content/groups/public/</url>
    </repository>
</repositories>

Make sure though to separate the language hint with a blank line before and after to set it apart from the code block. Your edit should look like this:

if there is text here make sure you have one extra blank line ...

<!-- language: lang-xml -->

    <repositories>
        <repository>
            <id>europa</id>
            <url>https://joinup.ec.europa.eu/nexus/content/groups/public/</url>
        </repository>
    </repositories>

See also the Markdown editing help and What is syntax highlighting and how does it work? for a list of supported syntax highlighters.

0

You must log in to answer this question.

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