Forums

Adjust output of SyntaxHighligher to use the code-tag? (4 posts)

  1. hangy
    Member
    Posted 2 years ago #

    If I see this correct, SyntaxHighlighter uses a <pre>-tag to mark the text to be interpreted as highlightable code. Even though this should not affect the highlighter or the most user's experience, wrapping the code into <code>, too, could probably make the output more useful.

  2. Viper007Bond
    Member
    Posted 2 years ago #

    <code> is designed for inline stuff while <pre> is designed for code blocks.

    Probably best to stick to <pre>.

  3. hangy
    Member
    Posted 2 years ago #

    To be honest, I think that the <pre>-tag itself has no specific semantic meaning, but just the information that the text is preformatted and should be shown as it was entered in the markup.
    So <pre> is semantically irrelevant, thus <pre><code>…</code></pre>, as partly suggested e. g. by HTML Dog, might be the best way to mark-up code.

  4. rob1n
    Member
    Posted 2 years ago #

    <pre> itself is meaningless -- just preformatted text, whereas <code> symbolizes code. I believe the standard is to use them together -- <pre><code> which is more semantic.

Topic Closed

This topic has been closed to new replies.

About this Topic