Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/styllloz/public_html/qa-include/qa-base.php on line 1175

Warning: session_start(): Cannot start session when headers already sent in /home/styllloz/public_html/qa-include/app/users.php on line 162

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/users.php on line 1267

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/page.php on line 356
Syntax highlighting? - code-flow.club | Q&A

Syntax highlighting?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
7 views
There is a library for syntax highlighting on the web page — SyntaxHighlighter (http://alexgorbatchev.com/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?


Note:

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 | 7 views

1 Answer

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

Where node — pre or unhighlighted.
by
110,608 questions
257,186 answers
0 comments
35,179 users