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

Inconsistent markdown underscores in sidebar and search #544

Closed
aldrinmartoq opened this issue Jun 4, 2018 · 1 comment
Closed

Inconsistent markdown underscores in sidebar and search #544

aldrinmartoq opened this issue Jun 4, 2018 · 1 comment

Comments

@aldrinmartoq
Copy link

Bug report

The sidebar and search are incorrectly handling underscores. Sometimes appears, sometimes are removed and sometimes partially removed. Ex: For this markdown ## utc_prev_offset, it appears as utcprevoffset in the search and sidebar.

Version

vuepress 0.10.0

Steps to reproduce

Sample page: https://a0.github.io/a0-tzmigration/data/#local-ini-str-local-fin-str

Source: https://github.com/a0/a0-tzmigration/blob/master/docs/data/README.md

What is expected?

They should look the same.

What is actually happening?

The underscores are removed.

  • For the title ### utc_offset it appears correctly: utc_offset.
  • For the title ### utc_prev_offset it appears wrong: utcprevoffset.
  • For the title ### local_ini_str, local_fin_str it appears wrong: localini_str, local_finstr.

Other relevant information

  • Your OS: Mac OS X 10.13.4
  • Node.js version: v8.9.4
  • Browser version: Google Chrome 67, Safari 11.1
  • Is this a global or local install? local
  • Which package manager did you use for the install? yarn
@ulivz
Copy link
Member

ulivz commented Jun 4, 2018

_ is a markdown syntax token. e.g. _text_ would be parsed as <em>text</em>.

While we need to display the plain text at sidebar nav links and search result items so the most the inline markdown was removed.

You can use \ to prevent the _ from being parsed. unfortunately, though you can make it display correctly in the markdown content, it is still wrong in sidebar. fixed at: 4503cfc

Now it should works:

  • Input:
## \_A\_B 

## \*A\*C

## \*\*A\*\*D

## \`A\`E

## _A_B 

## *A*C

## **A**D

## `A`E
  • Output:

image

Thanks for reporting that, please wait for next release.

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

2 participants