How to set a class to markdown **bold** style with markdown-it?

434 views Asked by At

I'm using @nuxtjs/markdownit Nuxt module, how can I add a class to bold style ? For instance, use Boostrap's primary class to the word Hello in **Hello** World!, to have it in blue.

<template>
  <v-col>
    <div v-html="$md.render(foo)"></div>
  </v-col>
</template>

<script>
export default {
  data() {
    return {
      foo: '**Hello** World!'
    }
  }
}
</script>

I'm using this config in nuxt.config.js:

markdownit: {
  injected: true
}
1

There are 1 answers

0
soroush On

Please try this

<script>
export default {
  data() {
    return {
      foo: '<span class="text-primary font-weight-bold">**Hello**</span> World!'
    }
  }
}
</script>