Answer the question
In order to leave comments, you need to log in
Syntax highlighting?
There is a library for syntax highlighting on a web page - SyntaxHighlighter ( http://alexgorbatchev.com/SyntaxHighlighter/ ). Blocks of text on the page (in the pre tag by default) are colorized when the page is initialized.
Problem: after the text in the block has changed, for example, as a result of Ajax, it loses coloring. How to ask the library to process a certain block again?
Note:
after the SyntaxHighlighter has run, the pre tags are replaced by others specified by the editor (the div in which the table is nested, and so on). My script writes text to the pre tag again.
PS In other words, how to force the module to color a certain block of code on the page, which appeared after the module had completed its work?
Answer the question
In order to leave comments, you need to log in
In the second version, I used
SyntaxHighlighter.highlight(0, node)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question