miaolz123 / vue-markdown

A Powerful and Highspeed Markdown Parser for Vue
https://miaolz123.github.io/vue-markdown/
MIT License
1.91k stars 258 forks source link

anchorAttributes prop is not applied to HTML anchor tags in the source #79

Open sandrapender opened 5 years ago

sandrapender commented 5 years ago

It seems that anchorAttributes only applies to Markdown content. Are there any plans to apply them to HTML anchor tags in the source?

Here is my test code:

<template>
    <div>
        <!-- this adds attributes to the link -->
        <vue-markdown :anchorAttributes="anchorAttributes" :source="markdown"></vue-markdown>
        <!-- this does NOT add attributes to the link -->
        <vue-markdown :anchorAttributes="anchorAttributes" :source="html"></vue-markdown>
    </div>
</template>

<script>

    import VueMarkdown from 'vue-markdown';

    export default {
        components: {
            VueMarkdown
        },
        data: function () {
            return {
                anchorAttributes: {
                    target: '_blank',
                    rel: 'noopener noreferrer nofollow'
                },
                markdown: '[A link to a website](https://google.com)',
                html: '<p><a href="https://google.com">A link to a website</a>'
            }
        }
    }
</script>