Home

Issue: 2238

Using markdownit with pug

[issue link]

I’m having trouble getting markdown rendered with pug and @nuxtjs/markdownit. Basically I’m trying to follow the examples but can’t get it to work.

lets say I have a markdown string coming from my cms content = ## Title h2\n### title h3\n\nLong text Long text Long text Long text Long text Long text Long text Long text Long text \n\n* gimme a list item\n* and one more yeehaw

Following the example I tried:

<template lang="pug">
div
   div(language="md") ## Title h2\n### title h3\n\nLong text Long text Long text Long text Long text Long text Long text Long text Long text \n\n* gimme a list item\n* and one more yeehaw
   div(language="md") {{ model }}
</template>

<script>
export default {
  data () {
    return {
      model: '## Title h2\n### title h3\n\nLong text Long text Long text Long text Long text Long text Long text Long text Long text \n\n* gimme a list item\n* and one more yeehaw'
    }
  }
}
</script>

Which renders me the following markup:

<div>
  <div language="md">## Title h2\n### title h3\n\nLong text Long text Long text Long text Long text Long text Long text Long text Long text \n\n* gimme a list item\n* and one more yeehaw
  </div>
  <div language="md">## Title h2
  ### title h3

Long text Long text Long text Long text Long text Long text Long text Long text Long text 

* gimme a list item
* and one more yeehaw
</div>
</div>

What am I doing wrong?

This question is available on Nuxt.js community (#c1964)