balddotcat / ox-slimhtml

a minimalist HTML org-export backend
68 stars 9 forks source link

Switch the order: <pre><code> instead of <code><pre> #2

Closed freetonik closed 5 years ago

freetonik commented 5 years ago

Hello!

First of all, thank you for this great package! I use it daily and find very useful (I write in Org and have to bear with those clanky HTML editors on a certain publishing platform).

I believe that <pre> should wrap <code> when exporting code blocks, not vice versa.

  1. It makes a bit more sense semantically, since <pre> is a block element, and <code> is an inline element.
  2. W3C recommendation https://www.w3.org/TR/html50/grouping-content.html#the-pre-element
  3. MDN docs suggest this too https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code#Notes

(btw, relevant thread https://twitter.com/freetonik/status/1075080034283610113)

Thanks.

balddotcat commented 5 years ago

Awesome - again, that is great to hear! Thanks for the commit!