-
Notifications
You must be signed in to change notification settings - Fork 1
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
Updated test and moved from remarkHtml to rehype #51
Conversation
'xml', | ||
]; | ||
schema.tagNames = schema.tagNames.concat(blocklyTags); | ||
|
||
module.exports.markdownToSyntaxTree = (source, plugin = 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.
It would be helpful to add a comment as to why we use this particular chain and that order matters (as we struggled a lot with this!)
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.
Sounds good. I found out how we manage the schema in our main repo and copied the same pattern.
@@ -23,12 +23,15 @@ | |||
"homepage": "https://github.com/code-dot-org/remark-plugins#readme", |
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.
Should we also bump the version, perhaps to a new major since we're making significant updates to the underlying transitives? 2.0
?
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 am not opposed to that at all.
package.json
Outdated
"unist-builder": "^2.0.3" | ||
}, | ||
"dependencies": { | ||
"rehype-sanitize": "^4.0.0" |
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.
Curious why this was moved to dependencies
as I see its only usage in test/utils.js
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 am not 100% sure of the difference between dependencies and devDependencies, but having rehype-sanitize
in dependencies also includes the hast-util-sanitize
dependency in our node-modules. I was reading this discussion
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.
devDependencies
means that we won't bundle it in our tree (only used for development). For example, prettier is not needed for the usage of this package but it is useful for the development of this package (to make it look prettier).
In this case, do we need hast-util-sanitize
somewhere in this package? We can probably just add that as a dependency rather than rehype-sanitize
Story
DependaBot marked a few dependencies in this repo as high or critical.
This PR does:
remark-parse
andunified
.remark-html
rehype-raw
,rehype-sanitize
,rehype-stringify
andremark-rehype
. (Note that more recent versions of the unified ecosystem are only ESM compatible)markdownToHtml
andmarkdownToSyntaxTree
using rehype libraries instead of remark-html as we do in our main repo.\n
introduced byremak-html
(We no longer use remark-html)codestudio
plugin as code studio pull-through was deprecated along with Curriculum Builder.After the update only two high-severity dependencies are left:
However we don't use this library on our server side, therefore this vulnerability can't be exploited.