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

IDs of headings with inline tokens (link, em, bold...) #456

Merged
merged 5 commits into from
Jan 20, 2018

Conversation

Feder1co5oave
Copy link
Contributor

@Feder1co5oave Feder1co5oave commented Jul 28, 2014

PR for #450

I hope it doesn't seem overkilling, I kept it as small as possible.
Comments are welcome. I'll be posting some tests, if I can manage to make them work.

Meanwhile I tested it with

### Heading with a [link](http://github.com/)

### Heading with some _italic text_

### Or some **strong**
(which doesn't really make any difference, here)

### Or even `code`

### What about ~~strikethrough~~

and I got

<h3 id="heading-with-a-link">Heading with a <a href="http://github.com/">link</a></h3>
<h3 id="heading-with-some-italic-text">Heading with some <em>italic text</em></h3>
<h3 id="or-some-strong">Or some <strong>strong</strong></h3>
<p>(which doesn&#39;t really make any difference, here)</p>
<h3 id="or-even-code">Or even <code>code</code></h3>
<h3 id="what-about-strikethrough">What about <del>strikethrough</del></h3>

which looks good to me.

Fixes #450, fixes #510

@Feder1co5oave Feder1co5oave changed the title Clean segments IDs of headings with inline tokens (link, em, bold...) Jul 28, 2014
@F1LT3R
Copy link

F1LT3R commented Mar 10, 2015

Is this still being looked at @chjj ?

@Feder1co5oave
Copy link
Contributor Author

@F1LT3R definitely no.

@F1LT3R
Copy link

F1LT3R commented Mar 10, 2015

As in... it shouldn't be, or... it hasn't been?

@Feder1co5oave
Copy link
Contributor Author

I meant marked is not being maintained any more

@F1LT3R
Copy link

F1LT3R commented Mar 10, 2015

Ah Ok. Thanks @Feder1co5oave.

I've just been testing out your clean-segments commit and I think it's a great improvement.

Is there something better NPM module for markdown that I should be using instead?

@Feder1co5oave
Copy link
Contributor Author

I'm still with marked, but there exist some more modern and maintained parsers out there. I haven't tried any yet so I can't help you.

@F1LT3R
Copy link

F1LT3R commented Mar 10, 2015

Thanks

@JCMais
Copy link

JCMais commented Mar 11, 2015

@F1LT3R
Copy link

F1LT3R commented Mar 11, 2015

Thanks @JCMais !!

@joshbruce
Copy link
Member

#981

@joshbruce joshbruce added this to the 0.4.0 - No known defects milestone Dec 25, 2017
@Feder1co5oave
Copy link
Contributor Author

I'll try and provide some tests, I think this is still relevant, even if it covers some edge cases only.

@Feder1co5oave
Copy link
Contributor Author

Added test cases.

@joshbruce
Copy link
Member

Getting two failing tests. Want to make sure they're because of some things fixed elsewhere before merging this in...if nothing else, they should be totally unrelated.

#10. def_blocks failed at offset 20. Near: "<blockquote><p>hello</p><p><ahref="foo">1</a>:hell".


Got:
<blockquote><p>hello</p><p><ahref="foo">1</a>:hell


Expected:
<blockquote><p>hello[1]:hello</p></blockquote><hr>
#32. links_reference_style failed at offset 878. Near: "tioncannotinterruptaparagraph.</p><p><ahref="/baz">bar</a></".


Got:
tioncannotinterruptaparagraph.</p><p><ahref="/baz">bar</a></


Expected:
tioncannotinterruptaparagraph.[bar]:/baz</p><p>[bar]</p><p>H

@Feder1co5oave
Copy link
Contributor Author

I confirm that they are related to something else, and they both should be solved by my two [commonmark] PRs.

@joshbruce joshbruce merged commit 19f6afe into markedjs:master Jan 20, 2018
@Feder1co5oave Feder1co5oave deleted the clean-segments branch January 20, 2018 21:12
@Feder1co5oave Feder1co5oave mentioned this pull request Jan 22, 2018
zhenalexfan pushed a commit to zhenalexfan/MarkdownHan that referenced this pull request Nov 8, 2021
IDs of headings with inline tokens (link, em, bold...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants