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

­ and ‐ not marked down correctly (SOLVED with v-html. Frontmatter rendering HTML) #2186

Closed
1 task done
Nastradoomus opened this issue Feb 16, 2020 · 3 comments
Labels
complexity: medium Medium complexity contribution welcome Contributions welcome effort: medium Up to a week topic: theme Relates to VuePress theme type: enhancement Request to enhance an existing feature

Comments

@Nastradoomus
Copy link

Nastradoomus commented Feb 16, 2020

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

Bug report

Steps to reproduce

Add hyphens manual to styles. Add ­ or ‐ to .md file(s).

What is expected?

Word wrap break word with hyphens.

What is actually happening?

HTML is rendered as ­

Other relevant information

markdown-it demo works properly.

OS: Windows 10 10.0.18362
CPU: (16) x64 Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz
Binaries:
Node: 13.7.0 - C:\laragon\bin\nodejs\node-v13.7.0\node.EXE
Yarn: 1.21.1 - C:\laragon\bin\nodejs\node-v13.7.0\yarn.CMD
npm: 6.13.6 - C:\laragon\bin\nodejs\node-v13.7.0\npm.CMD
Browsers:
Edge: 44.18362.449.0
npmPackages:
@vuepress/core: Not Found
@vuepress/theme-default: Not Found
vuepress: ^1.3.0 => 1.3.0
npmGlobalPackages:
vuepress: Not Found

@meteorlxy
Copy link
Member

meteorlxy commented Feb 17, 2020

Sorry but I cannot reproduce this issue. Things seem to work properly in my case.

In the home page of official docs:

image

Result:

image

Please provide a minimal reproduction repo, or more detailed reproduce steps

@meteorlxy meteorlxy added the needs reproduction Waiting for a reproduction link (codepen, code sandbox, GH repos) label Feb 17, 2020
@Nastradoomus
Copy link
Author

Nastradoomus commented Feb 18, 2020

I was blaming markdown-it but the problem really lies in templating. Sorry for wasting your time. I wasn't thinking clearly. While templating & becomes & and shy; is left without &.

Please modify index.md

---
home: true
heroImage: null
heroText: Shy ex­ample
tagline: Shy ex­ample
actionText: ex­ample
actionLink: example
features:
- title: Shy ex­ample
  details: Shy ex­ample
- title: Vue-Powered
  details: Enjoy the dev experience of Vue + webpack, use Vue components in markdown, and develop custom themes with Vue.
- title: Performant
  details: VuePress generates pre-rendered static HTML for each page, and runs as an SPA once a page is loaded.
footer: Footer
---
# EXAMPLE
Shy ex­ample

Screenshot_2020-02-18_12:50:07

@kefranabg kefranabg added complexity: medium Medium complexity contribution welcome Contributions welcome effort: medium Up to a week topic: theme Relates to VuePress theme type: enhancement Request to enhance an existing feature and removed needs reproduction Waiting for a reproduction link (codepen, code sandbox, GH repos) labels Feb 23, 2020
@Nastradoomus
Copy link
Author

Nastradoomus commented Mar 3, 2020

The double mustaches interprets the data as plain text, not HTML. In order to output real HTML, you will need to use the v-html directive:

In templates use:

<h2 v-html="feature.title"> </h2> <p v-html="feature.details" > </p>

instead of:

<h2>{{ feature.title }}</h2> <p> {{ feature.details }} </p>

Now you can use html tags with frontmatter.

@Nastradoomus Nastradoomus changed the title &shy; and &hyphen; not marked down correctly &shy; and &hyphen; not marked down correctly (SOLVED with v-html. Frontmatter rendering HTML) Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: medium Medium complexity contribution welcome Contributions welcome effort: medium Up to a week topic: theme Relates to VuePress theme type: enhancement Request to enhance an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants