Skip to content
This repository was archived by the owner on Jul 12, 2020. It is now read-only.

Upgrade anchor ID generation#92

Merged
yamgent merged 1 commit intoMarkBind:masterfrom
yamgent:upgrade-anchor-id
Dec 25, 2018
Merged

Upgrade anchor ID generation#92
yamgent merged 1 commit intoMarkBind:masterfrom
yamgent:upgrade-anchor-id

Conversation

@yamgent
Copy link
Member

@yamgent yamgent commented Dec 24, 2018

What is the purpose of this pull request? (put "X" next to an item, remove the rest)

• [X] Bug fix

Fixes MarkBind/markbind#413

What is the rationale for this request?
Anchor ID generation for vue-strap is different from MarkBind. It needs to be updated to match the one in MarkBind.

What changes did you make? (Give an overview)
Changed the anchor generation by following the implementation in markbind-it-anchor@5.0.0.

markbind-it-anchor used to use the strings package, which is why the original code for Panel.vue uses that as well. We are substituting it with the one found in version 5.0.0 because that is what the MarkBind side is currently using.

Provide some example code that this change will affect:

<panel header="## Header:, with comma" expand>
  Panel content
</panel>

Is there anything you'd like reviewers to focus on?
NIL

Testing instructions:

  1. npm run build.
  2. Copy vue-strap.min.js to your MarkBind asset/js.
  3. Init a new website with the example code above.
  4. Test that the anchor URL jumping works (the url should be of this form:
http://127.0.0.1:8080/#header%3A%2C-with-comma

The `slugify()` method is taken from the source code of
markdown-it-anchor@5.0.0[1], which MarkBind uses to generate anchor IDs.

[1] - https://github.com/valeriangalliat/markdown-it-anchor/blob/v5.0.0/index.js
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

markdown-it-anchor@5.0.0 generates anchor IDs differently

1 participant