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

Allow dynamically generated header ids and classes #614

Merged
merged 28 commits into from May 27, 2023

Conversation

SergioBenitez
Copy link
Contributor

@SergioBenitez SergioBenitez commented Oct 8, 2022

Changes the second (fragment identifier) and third (classes) fields of Tag::Heading to be of type CowStr from the previous &str, allowing dynamically generated values to be used in their place.

In my use of pulldown-cmark, I want to automatically generate heading IDs and have the markdown renderer emit them. This change makes that possible. Workarounds are possible, but maintaining the tree as close to the original source as possible is desired.

jfrimmel and others added 4 commits February 24, 2021 20:33
Changes the second (fragment identifier) and third (classes) fields of
`Tag::Heading` to be of type `CowStr` from the previous `&str`, allowing
dynamically generated values to be used in their place.
rhysd and others added 20 commits November 18, 2022 14:37
Bumps [bumpalo](https://github.com/fitzgen/bumpalo) from 3.10.0 to 3.12.0.
- [Release notes](https://github.com/fitzgen/bumpalo/releases)
- [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md)
- [Commits](fitzgen/bumpalo@3.10.0...3.12.0)

---
updated-dependencies:
- dependency-name: bumpalo
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
This feature is a breaking change because it modifies the `Heading`
variant of the `Tag` enum with named fields and the new `attrs` field.

Fixes: pulldown-cmark#634
YAML-style and pluses-delimited metadata blocks are supported, each one
in a different `Options` flag. This is a breaking change because a new
`Tag` enum variant is added.

Fixes: pulldown-cmark#580
…attrs

feat!: allow custom headings attributes with optional value. Fixes pulldown-cmark#634
…/bumpalo-3.12.0

dependencies: bump bumpalo from 3.10.0 to 3.12.0
Fix parser bug where link label gets broken by ] in code span
Make `html` and `escape` modules optional
…-lists

Add task list with a list item's first paragraph
@Martin1887
Copy link
Collaborator

Martin1887 commented May 18, 2023

This pull request must be updated because the new custom attributes field of headings.

Could you create a new commit fixing this, @SergioBenitez? If you cannot, I could update it.

Anyway, benchmarks are needed before merging the pull request to check that the performance impact is not excessive.

Thanks.

@Martin1887
Copy link
Collaborator

Performance is a bit lower in some benches, but consistency is important and the performance hurts are also reduced in use cases where headings ids, classes and attrs must be modified, so this can be merged.

@Martin1887 Martin1887 merged commit 951920d into pulldown-cmark:master May 27, 2023
1 check failed
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

Successfully merging this pull request may close these issues.

None yet

5 participants