vuepress icon indicating copy to clipboard operation
vuepress copied to clipboard

starting a paragraph with custom component doesn't create <p>

Open michael-brade opened this issue 4 years ago • 1 comments

  • [x ] I confirm that this is an issue rather than a question.

Bug report

I created a custom component in .vuepress/components/LaTeX.vue to typeset the LaTeX logo properly (just a span in HTML with CSS).

If I start a paragraph with that component like this:

<LaTeX> creates beautiful....

then the output is lacking the <p> element around the paragraph.

But if I now change the component's name to .vuepress/components/latex.vue, it works as expected.

Steps to reproduce

Create two custom components in .vuepress/components/LaTeX.vue and .vuepress/components/latex.vue, each with the contents:

<span>LaTeX</span>

and then create a README.md:

<LaTeX/> creates beautiful text.

<latex/> creates beautiful text.

What is expected?

I would expect both paragraphs to be identical.

What is actually happening?

However, the first paragraph is

<span>LaTeX</span> creates beautiful text.

the second one is

<p>
<span>LaTeX</span> creates beautiful text.
</p>

Other relevant information

  • Output of npx vuepress info in my VuePress project:
Environment Info:

  System:
    OS: Linux 4.19 Debian GNU/Linux bullseye/sid
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  Binaries:
    Node: 14.2.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    @vuepress/core:  1.5.0 
    @vuepress/theme-default:  1.5.0 
    vuepress: 1.5.x => 1.5.0 
  npmGlobalPackages:
    vuepress: 1.5.0

michael-brade avatar May 17 '20 22:05 michael-brade

I have the same issue. Does anyone know how to solve this problem?

Heunsig avatar Sep 14 '22 01:09 Heunsig