Skip to content

Plugins: auto-anchor: use smallest match #218

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
merged 1 commit into from
Sep 3, 2019

Conversation

harding
Copy link
Collaborator

@harding harding commented Aug 31, 2019

The auto-anchor plugin, when it saw a list item like this:

- [BOLTs #608][] provides a privacy update to [BOLT4][] that makes it

Was creating links with an anchor of bolts-608-provides-a-privacy-update-to-bolt4 because it was using a greedy match operator. This PR changes it to use the minimal-match operator *? so it produces the expected anchor of bolts-608.

I tested this by diffing the site output before and after this commit and manually reviewing each change:

## on this branch
make build
cp -a _site _new_site
git reset --hard HEAD^
make build
diff -ru _site _new_site | colordiff | less -R

@jnewbery
Copy link
Contributor

jnewbery commented Sep 3, 2019

LGTM. I ran the diff between the generated sites and all looks good.

ACK 9116d50

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.

2 participants