Tip

블로그에 소스코드 깔끔하게 올리기 - SyntaxHighLlighter

Moss 2010. 11. 20. 12:39
http://withrobot.tistory.com/180




티스토리에 적용법

버전 3에서 개행처리: 
   http://bryan7.tistory.com/10 
  http://bryan7.tistory.com/13
  https://bitbucket.org/alexg/syntaxhighlighter/issue/182/version-3-making-code-wrap


티스토리에서 사용할 때 몇 가지 팁

<pre>로 정상적인 결과가 나오지 않을 때

html 또는 java script 코드를 올릴 때는
  </head></body></html></script>를 각각 </!head></!body></!html></!script>
로 해서 tistory가 인식할 수 없게 만든다. 안 그러면 tistory가 해당 구문을 티스토리내 처리를 위한 로직으로 바꿔치기 한다.

SyntaxHighlighter가 Java와 C#의 Generic을 정상적으로 처리 못함으로 아래 script안에 코드를 넣어준다.
<script type="syntaxhighlighter" class="brush: java"><![CDATA[ put codes here ]]></script>