-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Propose: Improve highlight
API
#2277
Comments
Yes, the suggested API looks better to my taste. But I can't see enough value in it to justify API breaking change. |
Any objection to:
Both for clarity and simplicity. |
|
highlight
APIhighlight
API
@allejo Any thoughts on these API naming changes? I think this was a topic before we added you to the team. |
I agree with Egor where "start" isn't clear. I'd lean more towards:
|
After more though I don't like this highlightAllOnLoad vs highlightAll nonsense and forcing users to think about WHEN. I think instead:
A single API. |
I think I'm going to leave |
See highlightjs/highlight.js#2277 Also updates vf-component-libary to 11ty 0.12.1
Fixes the following deprecation warning that is logged by `highlightjs`: ``` Deprecated as of 10.7.0. highlight(lang, code, ...args) has been deprecated. Deprecated as of 10.7.0. Please use highlight(code, options) instead. highlightjs/highlight.js#2277 ```
- Migrated to ESM because some dependencies now require it. - Did not update `highlight.js` to v11 because it has many breaking changes. - Used non-deprecated `highlight.js` API. Refs: highlightjs/highlight.js#2277 Fixes: nodejs#38938 Co-authored-by: Antoine du Hamel <[email protected]> PR-URL: nodejs#38966 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
* Remove deprecated Linkify option. * Replace deprecated Highlight syntax. (highlightjs/highlight.js#2277)
Deprecated as of 10.7.0. highlight(lang, code, ...args) has been deprecated. Please use highlight(code, options) instead. highlightjs/highlight.js#2277
I appreciate the quick rundown on how to upgrade the code. |
Previous call signature was deprecated. See highlightjs/highlight.js#2277 Signed-off-by: Clark Fischer <[email protected]>
Previous call signature was deprecated. See highlightjs/highlight.js#2277 Signed-off-by: Clark Fischer <[email protected]>
Previous call signature was deprecated. See highlightjs/highlight.js#2277 Signed-off-by: Clark Fischer <[email protected]>
Previous call signature was deprecated. See highlightjs/highlight.js#2277 Signed-off-by: Clark Fischer <[email protected]>
* Fix viewing source of redacted events Clicking 'View Source' in the context menu of a redacted event causes an error, and the user gets no visible result. This fixes <ViewSource /> to indicate that the source is unavailable when a message has been redacted. The original source remains available. <SyntaxHighlight /> requires a non-null string for its `content` prop, and, in the case of redacted events, <ViewSource /> was passing `undefined`. This is ultimately because redacting an event causes `MatrixEvent.clearEvent` to be `undefined`, which <ViewSource /> wasn't checking. Fixes element-hq/element-web#24165 Signed-off-by: Clark Fischer <[email protected]> * Use correct highlight.js call Previous call signature was deprecated. See highlightjs/highlight.js#2277 Signed-off-by: Clark Fischer <[email protected]> Signed-off-by: Clark Fischer <[email protected]>
Following the dependency upgrade, when running the tests, the highlight.js dependency printed this warning: > Deprecated as of 10.7.0. highlight(lang, code, ...args) has been deprecated. > Deprecated as of 10.7.0. Please use highlight(code, options) instead. > highlightjs/highlight.js#2277 We address the deprecation by switching the call to the new form.
For those finding there way here from the deprecation warning it's easy to upgrade your code:
So to upgrade your code:
IE, just switch the order of the arguments and pass
language
andignoreIllegals
in the options object now.Advantages:
format(drive)
,highlight(code)
Checklist:
highlight
API as shown abovehighlightAuto
->highlight(code)
highlightAuto
is deprecatedhighlightBlock
->highlightElement
enh(parser) add highlightElement, deprecate highlightBlock #3003highlightBlock
-> deprecated enh(parser) add highlightElement, deprecate highlightBlock #3003fixMarkup
-> deprecated, will be removed with v11initHighlightingOnLoad
->highlightAll()
initHighlighting
->highlightAll()
The text was updated successfully, but these errors were encountered: