2

I am using Snippet, a jQuery plugin for highlighting code.

http://www.steamdev.com/snippet/

I got it working correctly for highlighting css, js, php etc. But it does not highlight my HTML. Here is my test page.

https://dl.dropbox.com/u/9883217/syntaxHighlighter/index.html

any ideas on why it does not highlight my html?

0

2 Answers 2

2

Your HTML is being parsed by the browser.

You need to escape it (replace < with &lt;, > with &gt;, etc.).

Sign up to request clarification or add additional context in comments.

Comments

0

With PHP you can use the function htmlentities

<?php
    $str = "Ein 'Anführungszeichen' ist <b>fett</b>";

    // Gibt aus: Ein 'Anf&uuml;hrungszeichen' ist &lt;b&gt;fett&lt;/b&gt;
    echo htmlentities($str);

    // Gibt aus: Ein &#039;Anf&uuml;hrungszeichen&#039; ist &lt;b&gt;fett&lt;/b&gt;
    echo htmlentities($str, ENT_QUOTES);
?>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.