Log in   Register a New Account

Accessify Forum - Independent Accessibility Discussion Since 2003; Professional, Moderated, Web-based, Archived

New to the forum?

Only an email address is required.

Register Here

Already registered? Log In

Currently Online

No registered users are online.

pre with name attribute

Reply with quote 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:

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
Reply with quote 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!
Reply with quote
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
Reply with quote 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.

Display posts from previous:   

All times are GMT

  • Reply to topic
  • Post new topic