2

I followed this post and setup SyntaxHighlighter for my blogger. In addition, I added to the head

http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushBash.js

for rendering bash code, and then I tried to render a line like this

<pre name="code" class="bash">
    ls > output.txt
</pre>

But the > becomes &gt;, and I have tried the following, as well: <, >, <>, ><, <1>, <1a>, <a1a>, <a a>, but none of them works, and all brackets get rendered to either &gt; or &lt;. I have even tried &#62;, but it becomes &gt;, too.

Surprisingly, <a> gets rendered to <a> correctly, so to me, seems that the brackets have to come in pair and there have to be some letters, but no space or numbers in between, why is that? How could I simply render the above line of code properly?

I found this problem when comparing these two posts:

  1. post 1: search for pip freeze &gt; requirements.txt. The corresponding html is pip freeze > requirements.txt.
  2. post 2: search for F3 F3 <space> C+n C+a F4. The corresponding html is also just F3 F3 <space> C+n C+a F4.
Community
  • 1
  • 1
zyxue
  • 7,904
  • 5
  • 48
  • 74

1 Answers1

-1

The head should look something like this:

<head>
<script type="text/javascript" src="shCore.js"></script>
<script type="text/javascript" src="shBrushBash.js"></script>
<link type="text/css" rel="stylesheet" href="Whatever_Theme_you_r_using.css">
<script type="text/javascript">SyntaxHighlighter.all();</script>
</head>

All you have to do is to change all the "<" symbols to "&lt;"

cronos
  • 536
  • 2
  • 8
  • 20