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

enh(parser) add highlightElement, deprecate highlightBlock #3003

Merged
merged 4 commits into from
Feb 22, 2021

Conversation

joshgoebel
Copy link
Member

@joshgoebel joshgoebel commented Feb 14, 2021

More work towards #2277.

Changes

  • adds highlightElement(el) API and new plugin callbacks
  • deprecates old highlightBlock(el) API and old callbacks
  • both sets of plugin callbacks will be supported until v12

Supporting both sets of plugin callbacks should allow plugins to be written that easily work with both v10 and v11 (for a smooth transition for all).

Old API will continue to be supported until v12.

  • Make sure API isn't double called if a plugin defines both for compatibility

Checklist

  • Added markup tests, or they don't apply here because...
  • Updated the changelog at CHANGES.md
  • Added myself to AUTHORS.txt, under Contributors

@joshgoebel joshgoebel mentioned this pull request Feb 14, 2021
8 tasks
@joshgoebel joshgoebel marked this pull request as draft February 14, 2021 19:20
@joshgoebel joshgoebel removed the 0-WIP label Feb 18, 2021
@joshgoebel joshgoebel marked this pull request as ready for review February 18, 2021 15:08
@joshgoebel joshgoebel merged commit 69b6931 into highlightjs:master Feb 22, 2021
@driesvints
Copy link

@joshgoebel could it be that this isn't reflected in the docs yet? highlightBlock isn't deprecated there yet and there's no docs on highlightElement. I'm seeing the below warnings but have no idea how to use the new highlightElement.

Screenshot 2021-05-26 at 11 46 50

@joshgoebel
Copy link
Member Author

The docs weren't building correctly. I fixed.

https://highlightjs.readthedocs.io/

Thanks. The API is the same for that method, only the name changed.

@driesvints
Copy link

@joshgoebel thanks for checking in on that! :)

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.

3 participants