jdan / cleaver

30-second slideshows for hackers
http://jdan.github.io/cleaver
MIT License
4.02k stars 305 forks source link

Syntax highlighting doesn't work sometimes #139

Closed mike-ward closed 8 years ago

mike-ward commented 8 years ago

Cleaver does not syntax highlight the following:

<todo>
  <h3>{ opts.title }</h3>

  <ul>
    <li each="{ item, i in items }>"{ item }</li>
  </ul>

  <form onsubmit="{ add }">
    <input>
    <button>Add #{ items.length + 1 }</button>
  </form>

  <style scoped>
    h3 { font-size: 14px; }
  </style>

  <script>
    this.items = []

    add(e) {
      var input = e.target[0]
      this.items.push(input.value)
      input.value = ''
    }
  </script>
</todo>

See http://mike-ward.net/talk-riotjs/#3 for reference.

jdan commented 8 years ago

Hey @mike-ward,

Looks like highlight.js doesn't support XML: http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html

How does HTML look?

mike-ward commented 8 years ago

Same result. Note, slide http://mike-ward.net/talk-riotjs/#12 is decorated with the XML tag and does highight.

Also, the docs indicate that XML is supported.

mike-ward commented 8 years ago

Found if I change the to js it highlights the code. Weird, but acceptable.