Skip to content

Conversation

AlextheYounga
Copy link
Contributor

@AlextheYounga AlextheYounga commented Oct 3, 2023

Description

This change adds the ability to use simple plugins within your vue markdown render component by simply passing plugins as an array of plugin libraries to the vue component props. It works on my machine, but let me know if you have any problems or concerns.

Thanks for building this plugin in the first place!

Example usage:

I wanted to use the MarkdownItAnchor plugin which is why I made this change. Here is how it looks on my project after this change:

<template>
    <main>
        <div id="article-body">
            <vue-markdown :source="markdown" :options="options" :plugins="plugins" />
        </div>
    </main>
</template>

<script setup>
import VueMarkdown from 'vue-markdown-render'
import MarkdownItAnchor from 'markdown-it-anchor';

const options = {
    html: true,
    linkify: true,
}

const plugins = [MarkdownItAnchor]
</script>

This change adds the ability to use simple plugins within your vue
markdown render component by simply passing plugins as an array of
plugin libraries to the vue component props.
Copy link
Contributor

@p-kuen p-kuen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good!

@p-kuen p-kuen merged commit 9c4f826 into cloudacy:master Oct 3, 2023
@p-kuen p-kuen linked an issue Oct 3, 2023 that may be closed by this pull request
@p-kuen
Copy link
Contributor

p-kuen commented Oct 3, 2023

Can you please open a PR to add your usage example to the README.md? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to install plugins?

2 participants