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

Badge Component HTML displays in Page Title when used in H1 #688

Closed
roberthamel opened this issue Jul 31, 2018 · 7 comments · Fixed by #711
Closed

Badge Component HTML displays in Page Title when used in H1 #688

roberthamel opened this issue Jul 31, 2018 · 7 comments · Fixed by #711
Labels
has PR Has a related PR

Comments

@roberthamel
Copy link

Bug report

Version

0.13.0

Steps to reproduce

  1. clone this repository
  2. run vuepress dev

What is expected?

Ideally, I would think that the following would occur:

  • the text SAMPLE: Sample Page Title would be parsed into the head title
  • the text SAMPLE: Sample Page Title would be parsed into the sidebar

At the very least, the HTML should not display.

What is actually happening?

  • The head title displays <Badge text="SAMPLE"/> Sample Page Title.
  • The sidebar displays <Badge text="SAMPLE"/> Sample Page Title.

screen shot 2018-07-31 at 11 06 44 am

Other relevant information

I am aware that I can override the header using the following front matter:

---
title: Sample Page Title
---

But, I have a situation where I want to use the badge component to differentiate the page from others.

I am able to use regex to override the theme in order to fix the sidebar, but from what I can tell, the page head title is generated by the vuepress cli.

  • Your OS: MacOS
  • Node.js version: 10.7.0
  • Browser version: Chrome 67
  • Is this a global or local install? global
  • Which package manager did you use for the install? yarn
@ulivz
Copy link
Member

ulivz commented Jul 31, 2018

<Badge/> component can ONLY be used at the tail of the headers.

@ulivz ulivz closed this as completed Jul 31, 2018
@roberthamel
Copy link
Author

So this framework, which is meant to be customizable, can only be customized as long as you explicitly don't place a tag in a certain place? I don't appreciate the tone of your response, or your rush to close this issue.

Even if I were to place the badge at the end of the header, as per your documentation, it would still display in the sidebar and in the title of the page if I used it in an h1 tag.

It can be fixed so easily. You're basically putting me in a position to fork vuepress and make the change myself. Why?

@ulivz
Copy link
Member

ulivz commented Jul 31, 2018

By default, the HTML in the header should be preserved, so for now we only remove the trailing HTML as the status identifier.

And for " It can't be used on h1 ", If it's truly a bug, we will fix it later.

In addition, since you said It can be fixed so easily, why not just giving a PR?

Please also pay attention to your tone, I am not what you think, can the programmer be simpler?

@ulivz ulivz reopened this Jul 31, 2018
@ulivz ulivz changed the title Badge Component HTML displays in Page Title when used in main header Badge Component HTML displays in Page Title when used in H1 Jul 31, 2018
@ulivz ulivz added the type: bug Something isn't working label Jul 31, 2018
@ulivz
Copy link
Member

ulivz commented Jul 31, 2018

I just checked:

# Introduction <Badge text="beta" type="warn"/>

image

I hope you can create a valid repro instead.

@ulivz ulivz added need repro and removed type: bug Something isn't working labels Jul 31, 2018
@ulivz
Copy link
Member

ulivz commented Jul 31, 2018

BTW, I had labeled the beta tag for Badge before I published it.

image

So you didn't really read the documentation, just thought that this one was very uncomfortable to use, and then sent me such a question —— So this framework, which is meant to be customizable? —— So VuePress is very useless in your eyes, right?

Many people love this project as much as I do, and we are all trying to do better, so I spent so much time and maintained this project for free. If you just want to complain, PLEASE DON'T use VuePress.

@roberthamel
Copy link
Author

Because this is a beta feature, I wanted to open an issue to make the maintainers aware of it. I was a little bit surprised that the issue was closed and dismissed so quickly. If the tone of my response was unpleasant, I apologize. I appreciate the work that you do, and any of the other maintainers involved in this project. All I ask is that you don't be so quick to dismiss in the future.

As to your point about me complaining, I have submitted a pull request to fix the problem with the meta title.

@ulivz ulivz added the has PR Has a related PR label Aug 1, 2018
@ulivz
Copy link
Member

ulivz commented Aug 1, 2018

@roberthamel

See: #689 (comment)

Could you close this issue and open a new feature request to support strip HTML from the left in headers extraction. ?

    expect(deeplyParseHeaders('# <Comp/> *H1* ')).toBe('# H1')
    expect(deeplyParseHeaders('# `<Comp/>` `H1`')).toBe('# <code><Comp></code> H1')

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has PR Has a related PR
Projects
None yet
2 participants