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

@nuxtjs/markdownit not parsing HTML tags #7

Open
adamkhan opened this issue Mar 13, 2019 · 3 comments
Open

@nuxtjs/markdownit not parsing HTML tags #7

adamkhan opened this issue Mar 13, 2019 · 3 comments

Comments

@adamkhan
Copy link

Version

1.2.3

Reproduction link

https://codesandbox.io/s/l780y229q7?fontsize=14

Steps to reproduce

Install @nuxtjs/markdownit, follow the instructions to inject text as laid out in its README, and include some HTML in the markdowned text.

What is expected ?

Markdownit will parse HTML.

What is actually happening?

HTML tags are rendered literalIy, at least, the ones I have in my text, namely span and cite.

Additional comments?

Previously I had been using vue-markdown, which did parse these tags. But I noticed in webpack analyze build that it (and other) plugins were adding huge javascript files to the build, so sought substitutes for them, and came to markdownit.

This bug report is available on Nuxt community (#c155)
@mthelm85
Copy link

mthelm85 commented Mar 17, 2019

Hi Adam,

I ran into this same issue and resolved it by including html: true in my markdownit options object (in nuxt.config.js):

  markdownit: {
    injected: true,
    html: true,
    use: [ 'markdown-it-highlightjs' ]
  },

Hope this solves your problem.

Matt

@adamkhan
Copy link
Author

adamkhan commented Mar 18, 2019

Hi Matt, Yes it did, thanks for chiming in!

If anybody else is reading this, my specific site doesn't need code so Mark's use: [ 'markdown-it-highlightjs' ] line can be omitted.

t might be worth mentioning at @nuxtjs/markdownit that the https://github.com/markdown-it/markdown-it docs list all the parameters.

@pi0 pi0 transferred this issue from nuxt-community/legacy-modules Dec 29, 2020
@alitnk
Copy link

alitnk commented Jun 6, 2021

Any way to give the options on the fly? like $md.render(markdown, { html: true })

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

No branches or pull requests

3 participants