Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add plugin support #17

Merged
merged 1 commit into from
Oct 3, 2023
Merged

feat: add plugin support #17

merged 1 commit into from
Oct 3, 2023

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