[kramdown-users] more on attribute rearrangment

Matt Neuburg matt at tidbits.com
Fri Jul 23 00:59:09 EDT 2010


(1) This is right (converting to html):

  <div markdown="1">
  {::nomarkdown}
  <a href="test" class="ha">hey</a>
  {:/}
  </div>

#=> 

<div>
  <a href="test" class="ha">hey</a>
</div>

(2) This is wrong, I think:

  <div markdown="0">
  <a href="test" class="ha">hey</a>
  </div>

#=>

<div>
  <a class="ha" href="test">hey</a>
  </div>

The output should be the same. Attribute order should be left alone. This is kind of a disaster; RubyFrontier absolutely requires the href attribute to be first in the <a> tag in order to do certain postprocessing on links. It looks like kramdown must be disassembling tags and reassembling them them with attributes in alphabetical order. This seems to violate the contract in the docs, which says "parsed as raw HTML block and left alone". This is not "left alone"! m.





More information about the kramdown-users mailing list