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

Support multibyte character in heading id #1209

Closed
kenchan0130 opened this issue Apr 9, 2018 · 3 comments
Closed

Support multibyte character in heading id #1209

kenchan0130 opened this issue Apr 9, 2018 · 3 comments
Labels
L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue

Comments

@kenchan0130
Copy link

Marked version:
0.3.18

Markdown flavor:
n/a

Markdown

# これは markdown です

Expectation

<h1 id="これは-markdown-です">これは markdown です</h1>

or

<h1 id="これはmarkdownです">これは markdown です</h1>

Result

<h1 id="-markdown-">これは markdown です</h1>

Cause

It seems that multibyte characters have been converted to hyphens in the processing of this part.

@UziTech UziTech added the L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue label Apr 9, 2018
@UziTech
Copy link
Member

UziTech commented Apr 9, 2018

A PR would be welcome

@UziTech
Copy link
Member

UziTech commented Apr 9, 2018

according to W3C id spec:

When specified on HTML elements, the id attribute value must be unique amongst all the IDs in the element’s tree and must contain at least one character. The value must not contain any space characters.

but this will be a breaking change.

/cc @Feder1co5oave

@UziTech
Copy link
Member

UziTech commented Apr 9, 2018

#981

I'm going to close this as duplicate. There are many different takes on generating header ids. Some people want hyphens combined when there are multiple in a row, some people don't. Some people want hyphens trimmed when they are at the beginning or end, some people don't.

Header ids are something we are looking at deprecating in the future so people can use their own algorithm to generate them.

@UziTech UziTech closed this as completed Apr 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue
Projects
None yet
Development

No branches or pull requests

2 participants