[kramdown-users] why can't kramdown just leave my HTML alone?

Matt Neuburg matt at tidbits.com
Wed Aug 4 11:25:22 EDT 2010

On or about 8/3/10 11:02 PM, thus spake "Thomas Leitner" <t_leitner at gmx.at>:

> Another reason is that the output produced by kramdown needs to valid
> HTML, always. So it has to parse HTML in order to ensure the validness
> and also correct small problems.
> The parsed HTML tags are converted to Element objects of type
> `:html_element` and the tag attributes are just key-value associations
> stored in the Element object. The order of HTML attributes when
> parsing is not important as far as I know... Since the order is not
> preserved when parsing HTML attributes I decided to output HTML
> attributes alphabetically.

Of course I guessed all that. But there is no need to rearrange the
attributes when parsing; for example, nokogiri parses without rearranging
the attributes (and nokogiri is the best HTML parser in the business). If
nokogiri can do it, we can do it! :) m.

matt neuburg, phd = matt at tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
Take Control of Exploring & Customizing Snow Leopard
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com

More information about the kramdown-users mailing list