pre with name attribute
Is there a way to modify the accepted attributes of html elements?
We’re using XStandard for our CMS (http://www.farcrycore.org/) and I’m tasked with getting a syntax highlighting tool to work. And I’ve run into a problem.
The syntax highlighter relies on the following format:
Obviously name is not a supported attribute of pre. However, its what the syntax highlighter requires and I’m not able to change that. Is it possible to config the editor instance to allow for this additional attribute?
Many thanks,
— geoff
We’re using XStandard for our CMS (http://www.farcrycore.org/) and I’m tasked with getting a syntax highlighting tool to work. And I’ve run into a problem.
The syntax highlighter relies on the following format:
Code: |
<pre name="code" class="html"> HTML markup goes here and is beautified. </pre> |
Obviously name is not a supported attribute of pre. However, its what the syntax highlighter requires and I’m not able to change that. Is it possible to config the editor instance to allow for this additional attribute?
Many thanks,
— geoff
Where did you get the syntax highlighter from? It could simply apply itself to the contents of anything marked up as <pre class=”html”> if its creators want it to. Contact the creators to ask about valid HTML output.
If the creators of this syntax highlighter refuse to produce valid HTML, use a different solution which takes web standards seriously. You don’t want 3rd-party code detracting from your flagship product!
If the creators of this syntax highlighter refuse to produce valid HTML, use a different solution which takes web standards seriously. You don’t want 3rd-party code detracting from your flagship product!
Cerbera wrote: |
Where did you get the syntax highlighter from? It could simply apply itself to the contents of anything marked up as <pre class=”html”> if its creators want it to. Contact the creators to ask about valid HTML output.
|
Well its just a little bit of magic needed for blogging, but I hear you. I’ve had a look at the underlying JS and made a few mods to make it work with:
Code: |
<pre> <code name="code" class="xml"> …my code goes here… </code> </pre> |
Seems to be more semantic than just pre.
— geoff
I agree with the use of <code>. However, the use of name=”code” is now redundant. Any <code> element which is inside a <pre> could have the syntax highlighting applied.
You also have class=”html” and class=”xml” for the script to hook into.
You also have class=”html” and class=”xml” for the script to hook into.