79719037

Date: 2025-07-29 17:51:07
Score: 1.5
Natty:
Report link

@Mohammed Si Abbou linked to a helpful blog post in the question's comments. For future reference, here is a code snippet replicating what the blog post recommended:

const md = new markdownit();
const {
  ref
} = Vue;

Vue.createApp({
  setup() {
    const message = ref("# Hello");

    return {
      md,
      message
    };
  }
}).mount("#app");
<div id="app">
  <div v-html="md.render(message)"></div>
  <textarea v-model="message"></textarea>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/3.5.4/vue.global.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/13.0.2/markdown-it.min.js" integrity="sha512-ohlWmsCxOu0bph1om5eDL0jm/83eH09fvqLDhiEdiqfDeJbEvz4FSbeY0gLJSVJwQAp0laRhTXbUQG+ZUuifUQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Mohammed
  • Looks like a comment (1):
  • Low reputation (0.5):
Posted by: Neill