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

Disable decamelize for anchor generation #667

Merged
merged 1 commit into from Feb 8, 2019
Merged

Disable decamelize for anchor generation #667

merged 1 commit into from Feb 8, 2019

Conversation

Xenonym
Copy link
Contributor

@Xenonym Xenonym commented Feb 3, 2019

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

• [X] Bug fix

Resolves #653.

What is the rationale for this request?
Currently, anchors generated by MarkBind are "decamelized", with camelCased words being split: MarkBind becomes mark-bind. This breaks compatibility with GFMD.

What changes did you make? (Give an overview)
I modified the slugify option passed to markdown-it-anchor to always call slugify() with decamelize: false.

Provide some example code that this change will affect:

# Headings with camelCase or PascalCase

Testing instructions:

  1. Create a MarkBind page with headings that have camelCase or PascalCase. Their anchors should not be "decamelized": # camelCase and PascalCase should have an anchor of #camelcase-and-pascalcase.

- for compatibility with GFMD
@yamgent
Copy link
Member

yamgent commented Feb 4, 2019

A vue-strap side PR is needed to complement this PR as well.

@Xenonym
Copy link
Contributor Author

Xenonym commented Feb 4, 2019

@yamgent vue-strap side PR created: MarkBind/vue-strap#95.

Copy link
Member

@yamgent yamgent left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@yamgent yamgent added this to the v1.17.4 milestone Feb 7, 2019
yamgent pushed a commit to MarkBind/vue-strap that referenced this pull request Feb 8, 2019
In MarkBind/markbind#667, we disabled decamelization for anchor headings
to retain compatibility with GFMD. 

Let's disable decamelization in vue-strap as well.
@yamgent yamgent merged commit 468b5b5 into MarkBind:master Feb 8, 2019
@Xenonym Xenonym deleted the anchors-no-decamelize branch February 8, 2019 08:25
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.

Anchor generation for PascalCase words unexpected
2 participants