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

Add a flag to turn on header ID generation. #125

Merged
merged 1 commit into from Oct 28, 2014

Conversation

Projects
None yet
3 participants
@halostatue
Contributor

halostatue commented Oct 27, 2014

  • Fixes #51, #101, and #102.
  • Uses the code mentioned by @shurcooL from his Github
    Flavored Markdown parser extension in a comment on #102.
    Since this was mentioned, I assumed that @shurcooL would be OK with
    this being included under the licence provided by blackfriday (there
    is no licence comment on his code).
  • I’ve added it behind another flag, EXTENSION_AUTO_HEADER_IDS, that
    would need to be turned on for it to work. It works with both prefix
    and underline headers.
Add a flag to turn on header ID generation.
- Fixes #51, #101, and #102.
- Uses the [code][gfm] mentioned by @shurcooL from his Github
  Flavored Markdown parser extension in a [comment on #102][comment].
  Since this was mentioned, I assumed that @shurcooL would be OK with
  this being included under the licence provided by blackfriday (there
  is no licence comment on his code).
- I’ve added it behind another flag, EXTENSION_AUTO_HEADER_IDS, that
  would need to be turned on for it to work. It works with both prefix
  and underline headers.

[gfm]: https://github.com/shurcooL/go/blob/3bec0366a85101d116bf88b477e92ea6cdd75e4e/github_flavored_markdown/main.go#L90-L102
[comment]: #102 (comment)
@halostatue

This comment has been minimized.

Show comment
Hide comment
@halostatue

halostatue Oct 27, 2014

Contributor

When combined with #124, the automatically generated header ID will be used in the TOC. A manually provided header # header {#someid} will be used in preference to the automatically generated header.

Contributor

halostatue commented Oct 27, 2014

When combined with #124, the automatically generated header ID will be used in the TOC. A manually provided header # header {#someid} will be used in preference to the automatically generated header.

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Oct 28, 2014

Collaborator

I assumed that @shurcooL would be OK with this being included under the licence provided by blackfriday

I'm absolutely fine with that if it's helpful, no worries.

I did recently move that functionality out into a separate smaller package, so it's possible to import it without bringing in too many unrelated Go dependencies. See sanitized_anchor_name and shurcooL/go@c801d13.

Collaborator

dmitshur commented Oct 28, 2014

I assumed that @shurcooL would be OK with this being included under the licence provided by blackfriday

I'm absolutely fine with that if it's helpful, no worries.

I did recently move that functionality out into a separate smaller package, so it's possible to import it without bringing in too many unrelated Go dependencies. See sanitized_anchor_name and shurcooL/go@c801d13.

@dmitshur

This comment has been minimized.

Show comment
Hide comment
@dmitshur

dmitshur Oct 28, 2014

Collaborator

The changes look good to me. Nice job adding tests too. It should close all those 3 issues.

But I'm not the best person to review this PR because this optionally (behind a flag) affects the HTML renderer, and I personally only use the blackfriday Markdown parser with my GFM renderer, which already does this functionality by default, so I'll never get a chance to use this.

Collaborator

dmitshur commented Oct 28, 2014

The changes look good to me. Nice job adding tests too. It should close all those 3 issues.

But I'm not the best person to review this PR because this optionally (behind a flag) affects the HTML renderer, and I personally only use the blackfriday Markdown parser with my GFM renderer, which already does this functionality by default, so I'll never get a chance to use this.

rtfb added a commit that referenced this pull request Oct 28, 2014

Merge pull request #125 from halostatue/auto-header-id
Add a flag to turn on header ID generation.

@rtfb rtfb merged commit 7c8f3c1 into russross:master Oct 28, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@rtfb

This comment has been minimized.

Show comment
Hide comment
@rtfb

rtfb Oct 28, 2014

Collaborator

Thanks, @halostatue!

Collaborator

rtfb commented Oct 28, 2014

Thanks, @halostatue!

@halostatue halostatue deleted the halostatue:auto-header-id branch Nov 1, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment