| Project: | GeSHi Filter for syntax highlighting |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I hope you don't mind me putting in another issue. I was searching around on the conventions used for setting languages. I think I know why you chose type. It's similar to setting mime types. Even when working with javascript the language attribute was deprecated for type. I also saw 'lang' being recommended in another thread but the W3C says that "Computer languages are explicitly excluded from language codes".
http://www.w3.org/TR/html4/struct/dirlang.html#h-8.1.1
Well, in the context 'type' is being used it's not valid. It isn't a big deal since geshi will take over but I'm completely anal -link to help your english. ;). It also would work well with textile and markup since a class could easily be set on any element. I hope you consider replacing type with class. If not, I can live with it. Thanks!
Comments
#1
This is actually a very minor issue. There are more important things to fix so I'm closing it for now.
#2
Here is a patch that at least allows this for people who care enough by adding a variable_get wrapper. I'll leave it up to the maintainers if this is important enough to add an interface for, but I think it certainly doesn't hurt to have the option. Incidentally I needed this not so much for the XHTML compliance, but because it enables be to misuse the TinyMCE style dropdown to select the language on
<pre>tags using a style attribute.#3
I am considering this module (for D6) and I don't like the non-standard 'language' attribute. It would be better to let the user choose an attribute name, or go with a standard attribute, for compatibility's sake. (Other anal here.)
#4
'language' is not the only possible attribute to set the source code language.
The options are:
"type", "lang" and "language"
What other options do you propose?
Also note that there is no "standard": GeSHi filter is not designed to work on strict XHTML markup or something: it works instead on an intermediate XML-like markup with stuff like "[java]", "<python>" or "<code type="c++">".
(The output of GeSHi filter is of course valid HTML.)
#5
From the listed options, only 'lang' is a standard HTML attribute, but as mentioned before, it is only meant to be used for natural languages, not for computer languages. Looking at the list of allowed attributes, 'class' seems like the natural candidate for me. That's also what the original poster was asking for. :)
I am asking for this feature, because I would like to keep the original posts on my website as "standard" as possible. So that I am not tied to certain modules, or even to Drupal. The content of node body is just valid HTML.
Thank you very much for your fast reply!
#6
makes sense
done: http://drupal.org/cvs?commit=229984
#7
Wow, this was really fast!
I tested the CVS HEAD (6.x-1.x-dev) version, and it works perfectly with <code class="something">.
At first, I was unable to find out what attributes are accepted, but the REAME.txt file correctly points to the "Compose tips":
Where, 'class' is now listed together with 'type', 'lang', and 'language'.
Thank you very much!
#8
Automatically closed -- issue fixed for 2 weeks with no activity.