Search code examples
htmlhtml-escape-characters

Python code disappears from html code


particleShape1.incandescencePP=<<rand(0.8.1),rand(0,0.5),rand(0,0.5);  #rands are r,g,b, 1=100%.

I wanted the above line to read as is in a html document. Right now without any tags part of it disappears completely. Any ideas how I can get this to stay visible with the formatting I have on the document? Thanks!


Solution

  • You need to use pre tags:

    <pre> particleShape1.incandescencePP=<<rand(0.8.1),rand(0,0.5),rand(0,0.5); #rands are r,g,b, 1=100%. </pre>

    ...replacing any < with &lt; because they are still parsed with pre tags:

    <pre> particleShape1.incandescencePP=&lt;&lt;rand(0.8.1),rand(0,0.5),rand(0,0.5); #rands are r,g,b, 1=100%. </pre>

    http://jsfiddle.net/JDQRG/