Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

C::B Lexers

(1/2) > >>

sethjackson:
On this page it says HTML is not supported....

http://wiki.codeblocks.org/index.php?title=Languages_supported_by_Code::Blocks_lexers

The XML lexer handles the HTML styling too. Just check the filemasks int the XML lexer.....

So do I need to write a seperate HTML lexer or no? XML supports free form tags where as HTML doesn't so if you are coding HTML and you type a tag like this


--- Code: (html) ---<asdf></asdf>

--- End code ---

The XML lexer says OK that is fine, but in HTML that is not a valid tag...... So do we need to split the XML and HTML lexers into two seperate files (I think this would be a good idea)????

takeshimiya:
Yes, XML and HTML need to be separated.

In SciTE for example, any keyword that is not on the html standard appears in red.

thomas:
Having the xml lexer handle HTML is not worse than what any specialised HTML editor that I know of does, as far as syntax styling is concerned. If, however, you insist that this is not good enough, then you will have to accept that Code::Blocks will never support HTML.

Neither Code::Blocks nor SciTE are suitable tools for properly editing HTML, and will probably never be. One reason is of course the lack of a preview window, but the much more important and much more difficult issue is the correct syntax styling of tags.
Even among editors specialised on editing web content, there are few, if any, that really support HTML. In fact, most of them simply highlight everything inside < > and be done with it.


--- Quote ---any keyword that is not on the html standard appears in red
--- End quote ---
The problem is that no such thing as "the standard" exists.
"HTML" comes in many different versions (for example 3.2, 4.01 transitional/strict/frames, and XHTML 1.0). Each of these defines different tags (or attributes) and makes one or the other thing legal or illegal, optional or mandatory.
To properly support HTML, you would have to do a lot more than list a few keywords in a lexer. One solution could be to run a validator (such as tidy) on the document first.
I know of no editor which is doing such a thing.

killerbot:
nvu ?

thomas:
Well... lol, yes. You'll agree that nvu is a little bit out of the scope of cbEditor's or SciTE's capabilities, though ;)

Navigation

[0] Message Index

[#] Next page

Go to full version