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

Allows h1/h2/h3/h4/h5/h6 tags to preserve their dom id #27

Closed
fengmk2 opened this issue Jan 6, 2015 · 4 comments
Closed

Allows h1/h2/h3/h4/h5/h6 tags to preserve their dom id #27

fengmk2 opened this issue Jan 6, 2015 · 4 comments

Comments

@fengmk2
Copy link

fengmk2 commented Jan 6, 2015

e.g.:

# h1

## h2

### [h3](/already/linky)

#### h4

##### h5

###### h6

# h1 foo bar 中文 no-ascii should be ok_-/

=>

<h1 id="h1">h1</h1>
<h2 id="h2">h2</h2>
<h3 id="h3-%2FFalready%2Flinky"><a href="/already/linky">h3</a></h3>
<h4 id="h4">h4</h4>
<h5 id="h5">h5</h5>
<h6 id="h6">h6</h6>
<h1 id="h1-foo-bar-%E4%B8%AD%E6%96%87-no-ascii-should-be-ok_-%2F">h1 foo bar 中文 no-ascii should be ok_-/</h1>

Should I implementation this with syntax extensions?

@puzrin
Copy link
Member

puzrin commented Jan 6, 2015

gjtorikian/html-pipeline#111 (comment)

Simple implementation will be unsafe (both via id & name) or not universal (with prefixes), that's the main reason why we not added heading anchors by default yet. That needs discussion.

Right now it's better to implement those locally via md.renderer.rules.header override, if you need those and can't wait. Or, if you decide to publish plugin - write there with "big letters" about possible security problems on unproper use.

@fengmk2
Copy link
Author

fengmk2 commented Jan 6, 2015

OK, I try locally first.

@puzrin
Copy link
Member

puzrin commented Jan 6, 2015

I've structured prelimibary info in #28

Anchors are required - no question. Just don't know what to do by default, to protect users from obvious security holes.

@fengmk2
Copy link
Author

fengmk2 commented Jan 6, 2015

mv to #28

@fengmk2 fengmk2 closed this as completed Jan 6, 2015
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