Skip to content

build: generate proper anchor ids for headings in markdown #19371

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

Merged

Conversation

devversion
Copy link
Member

Currently we compute the anchor ids for headings in guides and
overviews manually. Our logic here does not match with the ids generated
by Github, so one needs to either fix up all references to the anchor
for the docs, but that will break the links in most markdown editors.

We fix this by using the integrated slugify method provided by the
marked package. This one seems to match the usual id generation in
markdown files (as in Github and most markdown editors).

This fixes links in the cdk-testing harness overview as observed
originally in #19366.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 15, 2020
@devversion devversion force-pushed the build/generate-proper-anchors-markdown branch from 3881a75 to 037fb7a Compare May 15, 2020 12:28
@devversion devversion marked this pull request as ready for review May 15, 2020 12:53
@devversion devversion requested review from jelbourn and a team as code owners May 15, 2020 12:53
@devversion devversion added merge safe P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels May 15, 2020
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one little comment

Currently we compute the anchor ids for headings in guides and
overviews manually. Our logic here does not match with the ids generated
by Github, so one needs to either fix up all references to the anchor
for the docs, but that will break the links in most markdown editors.

We fix this by using the integrated `slugify` method provided by the
`marked` package. This one seems to match the usual id generation in
markdown files (as in Github and most markdown editors).

This fixes links in the cdk-testing harness overview as observed
originally in angular#19366.
@devversion devversion force-pushed the build/generate-proper-anchors-markdown branch from 037fb7a to 58ee7b4 Compare May 15, 2020 15:49
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added the action: merge The PR is ready for merge by the caretaker label May 15, 2020
@mmalerba mmalerba merged commit 2635f0c into angular:master May 15, 2020
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants