-
-
Notifications
You must be signed in to change notification settings - Fork 193
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 headingpermlink attaching to the heading #939
Allow headingpermlink attaching to the heading #939
Conversation
And now I had to realize that I had created the branch from 2.3 instead of the main :( |
Is it a breaking change if the class was final (can not extend) and the first parameter is the same? Yes, can be, i have to give the other two param a default value. |
Could you explain the value here? Like, I fully understand what this feature allows, but I'm having trouble understanding why this would be important to allow. What's the use case here? Knowing that will help me to give this a proper review :)
Yes, because any external code that used to instantiate a new |
It first ensures the separation of the anchor and the link to it. Currently, for example, the icon for an anchor is set by configuration and also decided where it is set. But this decision should be made by the desginer e.g. via CSS. Further I would like to add the possibility that the It sounds more plausible to me to use the already existing extension for Headline instead of parsing the document again and adding more HTML. EDIT: It also makes more sense to me that the id belongs around |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thank you for those extra details! I agree, I think changes like this could be useful :)
Would you mind making a few changes to the proposed implementation?
If I'm already working on it, should I include the ability to disable the If so, extend the |
Yeah, that makes sense to me! Let's do it :) |
a98d49e
to
52a1985
Compare
52a1985
to
006a0d6
Compare
Thanks for the contribution! This will be released in 2.4.0. |
Additionally:
https://commonmark.thephpleague.com/2.3/extensions/heading-permalinks/
This extension makes all of your heading elements (<h1>, <h2>, etc) linkable so that users can quickly grab a link to that specific part of the document - almost like the headings in this documentation!
Yup and this update, allows setting the anchor directly on the headline. Just like you have in your documentation xD
I also think that maybe there should be the possibility to disable the tag completely but then have the anchor in the headline.
I put a lot of effort to consider everything, UnitTest, documentation updated and no breaking changes. I hope that the pull request gets your approval.