daliborgogic / nuxt-interpolation

Nuxt.js module as directive for binding every link to catch the click event, and if it's a relative link router will push.
https://www.npmjs.com/package/nuxt-interpolation
44 stars 2 forks source link

@nuxtjs/markdownit support #21

Open vettndr opened 3 years ago

vettndr commented 3 years ago

Hi, I'm using this library with @nuxtjs/markdownit.

It would be very cool if the library automatically set target="blank" attribute if the url is an external link. In the Storyblok markdown editor I created a text field which contains: [www.example.com](https://www.example.com/) Am I missing something?

vettndr commented 3 years ago

22

daliborgogic commented 3 years ago

Hi @vettndr you need to add directive v-interpolation.


<template>
  <div v-interpolation v-html="hello"></div>
</template>

<script>
  import hello from '../hello.md'

  export default {
    computed: {
      hello() {
        return hello
      }
    }
  }
</script>
vettndr commented 3 years ago

@daliborgogic Of course, I did it.

I created the PR to achieve the expected behavior. I’ll update it asap.