-
Notifications
You must be signed in to change notification settings - Fork 515
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
chore(deps): bump markdown dependencies #9980
Conversation
Bumps [unified](https://github.com/unifiedjs/unified) from 10.1.2 to 11.0.4. - [Release notes](https://github.com/unifiedjs/unified/releases) - [Changelog](https://github.com/unifiedjs/unified/blob/main/changelog.md) - [Commits](unifiedjs/unified@10.1.2...11.0.4) --- updated-dependencies: - dependency-name: unified dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [remark-parse](https://github.com/remarkjs/remark) from 10.0.2 to 11.0.0. - [Release notes](https://github.com/remarkjs/remark/releases) - [Changelog](https://github.com/remarkjs/remark/blob/main/changelog.md) - [Commits](https://github.com/remarkjs/remark/compare/[email protected]@11.0.0) --- updated-dependencies: - dependency-name: remark-parse dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [remark-gfm](https://github.com/remarkjs/remark-gfm) from 3.0.1 to 4.0.0. - [Release notes](https://github.com/remarkjs/remark-gfm/releases) - [Commits](remarkjs/remark-gfm@3.0.1...4.0.0) --- updated-dependencies: - dependency-name: remark-gfm dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [remark-rehype](https://github.com/remarkjs/remark-rehype) from 10.1.0 to 11.0.0. - [Release notes](https://github.com/remarkjs/remark-rehype/releases) - [Commits](remarkjs/remark-rehype@10.1.0...11.0.0) --- updated-dependencies: - dependency-name: remark-rehype dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [rehype-format](https://github.com/rehypejs/rehype-format) from 4.0.1 to 5.0.0. - [Release notes](https://github.com/rehypejs/rehype-format/releases) - [Commits](rehypejs/rehype-format@4.0.1...5.0.0) --- updated-dependencies: - dependency-name: rehype-format dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [rehype-stringify](https://github.com/rehypejs/rehype) from 9.0.4 to 10.0.0. - [Release notes](https://github.com/rehypejs/rehype/releases) - [Changelog](https://github.com/rehypejs/rehype/blob/main/changelog.md) - [Commits](https://github.com/rehypejs/rehype/compare/[email protected]@10.0.0) --- updated-dependencies: - dependency-name: rehype-stringify dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [react-markdown](https://github.com/remarkjs/react-markdown) from 8.0.7 to 9.0.0. - [Release notes](https://github.com/remarkjs/react-markdown/releases) - [Changelog](https://github.com/remarkjs/react-markdown/blob/main/changelog.md) - [Commits](remarkjs/react-markdown@8.0.7...9.0.0) --- updated-dependencies: - dependency-name: react-markdown dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
ce26803
to
da7d445
Compare
This reverts commit 4e9a454.
const match = /language-(\w+)/.exec( | ||
className || "" | ||
); | ||
const lang = Prism.languages[match?.[1]]; | ||
return !inline && lang ? ( | ||
return lang ? ( |
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.
@LeoMcA I don't know what inline
distinguishes, but didn't see a difference locally.
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.
Seems to distinguish between inline/block code blocks, however the presence/lack of a language-foobar
class also seems to do the same. Even then, if I force Prism to operate on inline code blocks too (by setting lang
to Prism.languages["css"]
for instance), it seems to fail gracefully with inline blocks
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.
You're right, that makes sense. And what a relieve!
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.
looks good!
const match = /language-(\w+)/.exec( | ||
className || "" | ||
); | ||
const lang = Prism.languages[match?.[1]]; | ||
return !inline && lang ? ( | ||
return lang ? ( |
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.
Seems to distinguish between inline/block code blocks, however the presence/lack of a language-foobar
class also seems to do the same. Even then, if I force Prism to operate on inline code blocks too (by setting lang
to Prism.languages["css"]
for instance), it seems to fail gracefully with inline blocks
@@ -257,12 +257,12 @@ export function AIHelpInner() { | |||
</div> | |||
); | |||
}, | |||
code: ({ inline, className, children, ...props }) => { | |||
code: ({ className, children, ...props }) => { |
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 notice <code>
tags get an ugly node="[object Object]"
attribute set on them, due to ...props
, we should destructure it to remove it:
code: ({ className, children, ...props }) => { | |
code: ({ className, children, node, ...props }) => { |
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'll open a separate PR for it.
* chore(deps): bump unified from 10.1.2 to 11.0.4 * chore(deps): bump remark-gfm from 3.0.1 to 4.0.0 * chore(deps): bump remark-parse from 10.0.2 to 11.0.0 * chore(deps): bump remark-rehype from 10.1.0 to 11.0.0 * chore(deps): bump rehype-format from 4.0.1 to 5.0.0 * chore(deps): bump rehype-stringify from 9.0.4 to 10.0.0 * chore(deps): bump react-markdown from 8.0.7 to 9.0.0 * fix(ai-help): migrate to react-markdown v9
* chore(deps): bump unified from 10.1.2 to 11.0.4 * chore(deps): bump remark-gfm from 3.0.1 to 4.0.0 * chore(deps): bump remark-parse from 10.0.2 to 11.0.0 * chore(deps): bump remark-rehype from 10.1.0 to 11.0.0 * chore(deps): bump rehype-format from 4.0.1 to 5.0.0 * chore(deps): bump rehype-stringify from 9.0.4 to 10.0.0 * chore(deps): bump react-markdown from 8.0.7 to 9.0.0 * fix(ai-help): migrate to react-markdown v9
Summary
Same as #9896, but also bumps
react-markdown
.Problem
Updating
unified
,remark-{gfm,parse,rehype}
andrehype-{format,stringify}
broke AI Help for certain answers, becausereact-markdown
v8 doesn't seem to be fully compatible withunified
v11.Solution
Bump
react-markdown
from v8 to v9 at the same time, and migrate the breaking change (theinline
parameter no longer being exposed to thecode
handler).How did you test this change?
Tested with the following AI Help data (set with
localStorage.put("ai-help", "...")
):Compared the
outerHTML
of prod with my local branch and saw no difference.