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 internal links with text equal to their anchor #249

Open
jyasskin opened this issue Jan 5, 2025 · 1 comment
Open

Allow internal links with text equal to their anchor #249

jyasskin opened this issue Jan 5, 2025 · 1 comment

Comments

@jyasskin
Copy link
Contributor

jyasskin commented Jan 5, 2025

I'm converting a Markdown document that uses ... description of all [Components](#components) to make a link whose text is "Components" to a section whose id also happens to be "components". Unfortunately,

if target.downcase == res.downcase
res = '' # get rid of raw anchors leaking through
end

turns that linking style into <xref target="components"/> with no linking text, which results in output like "description of all Section 3". I could link with {{components}}{:format="title"}, but that produces "Components", which is inconsistent with all the other internal links that show up like "Grammar (Section 4)" (with both parts linked). I may wind up turning all internal links into Components ({{components}}) so they can all be consistent, but it would be nice to be able to link the text in addition to the section number.

It seems like there should be a way to tell kramdown-rfc that this particular document doesn't have accidental anchors in linking text.

jyasskin added a commit to jyasskin/kdl that referenced this issue Jan 5, 2025
@cabo
Copy link
Owner

cabo commented Jan 5, 2025

Oh yes.
This has hit me already as well.
I need to find out why that workaround was necessary and whether I can defeat it.
Might need a couple of weeks right now...

jyasskin added a commit to jyasskin/kdl that referenced this issue Jan 6, 2025
jyasskin added a commit to jyasskin/kdl that referenced this issue Jan 11, 2025
jyasskin added a commit to jyasskin/kdl that referenced this issue Jan 18, 2025
zkat pushed a commit to kdl-org/kdl that referenced this issue Jan 18, 2025
Fixes: #461

* Initial conversion to Internet-Draft.

* Setup repository for draft-marchan-kdl2 using /~https://github.com/martinthomson/i-d-template

* Remove unnecessary changes.

* Tweak source to make the I-D build.

* Fix zkat's name. Guess at their preferred initials.

* Separate links where linking text equals the anchor.

This works around cabo/kramdown-rfc#249.

* Replace horizontal rules with subsections.

RFCXML v3 doesn't include horizontal rules.

* Use ~~~kdl  instead of `` for strings with significant whitespace.

That compiles to <sourcecode> which preserves sequences of spaces.

* Give breadcrumbs to the RFC format definitions.

* Point contributors to https://author-tools.ietf.org/.

For if installing the dependencies is inconvenient.

* Separate a code block from adjacent text.

* Remove a workflow that overwrites customized files.

* Remove the 'archive' workflow.

* Use "Term ({{term}})" uniformly instead of just when the term matches the anchor.

* Fix the instructions for preserving the RFCXML.

* Remove the default copyright notice until the spec is relicensed.

* Take the IETF licensing details out of CONTRIBUTING.md.
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