-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
fix: only warn if langPrefix is changed #2796
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. This seems reasonable.
src/defaults.js
Outdated
@@ -9,7 +9,7 @@ export function getDefaults() { | |||
headerPrefix: '', | |||
highlight: null, | |||
hooks: null, | |||
langPrefix: 'language-', | |||
langPrefix: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this is semver major because its a breaking change to the public API
import marked from 'marked';
const result = marked.getDefaults();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we considered using (and is it possible to use) empty types instead of null
?
Coming at it from someone who doesn't know the architecture and intent, I'd need to search and find what's expected from the argument list, yeah?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is true. And any extensions that rely on options.langPrefix
could break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this PR to only check if langPrefix has changed from it's default value before warning about it.
## [5.0.1](v5.0.0...v5.0.1) (2023-05-06) ### Bug Fixes * only warn if langPrefix is changed ([#2796](#2796)) ([d193694](d193694))
Marked version: 5.0.0
Description
This removes the warning for langPrefix unless it is changed.
The default warnings can be silenced by setting the following options:
Contributor
Committer
In most cases, this should be a different person than the contributor.