Awesome q2a theme

Syntax highlighting?

0 like 0 dislike
There is a library for syntax highlighting on the web page — SyntaxHighlighter ( Blocks of text on the page (by default, the tag pre) rastsvechivaya when the page is initialized.

Problem: after the text in the block has changed, for example, as a result of operation Ajax, he loses the coloring. How to ask the library to re-process a block?


after working SyntaxHighlighter pre tags are replaced by others, posed by the editor (div, which is nested table, and so on). Again, my script writes the text in a pre tag.

P. S. in Other words, how to get the module to colorize a code block on the page that appeared after the module to your work?
by | 27 views

1 Answer

0 like 0 dislike
In the second version I used for this
SyntaxHighlighter.highlight(0, node)

Where node — pre or unhighlighted.
110,608 questions
257,187 answers
40,796 users