changing pre tag to code

This discussion is related to the CreativeSyntaxHighlighter addon.
jackmaessenjackmaessen ✭✭✭
edited November 2015 in Feedback

There seems to be a problem with using the pre tag in combination with html in it. The html is executed between the pre tags.
Like in this discussion ( was told; you can avoid it to add code tags within the pre tags like below:

    <pre lang="html">
   html  code goes here

But doing it like above, the output in the codeblock will be:

html code goes here

So the advise of @creativedreams to change the pre tag in code is a good option. This should be changed in the file shInit.js in the js folder of the plugin:

'tagName':       'code',     // Facilitates using a different tag.

But that is not enough to make it work. What happens: if you submit a piece of code, the highlighter seems to work normal. But after a refresh, the complete div with its unique , table, class gutter and code inside it, is gone.
You need to make 2 more changes; in the file shLegacy.js and in the file shCore.js, both in the js folder.
In those 2 files, search for "pre" and change the "pre" to "code"

In shLegacy.js:

In shCore.js:

Well, i thought this might be useful for the developer and for other users who wants to change from pre to code tag



Sign In or Register to comment.