-
-
Notifications
You must be signed in to change notification settings - Fork 737
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: sanitize code from the TOC #1204
Conversation
✅ Deploy Preview for asyncapi-website ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
Left two suggestions that can improve your code. Also, you have to add string-sanitizer
to the package.json file or, otherwise, it won't work outside your machine because it won't be installed (that's why tests are failing).
That said, if the only thing we have to sanitize in ToC is the backtick symbol (`), then also consider just removing it yourself instead of using the string-sanitizer dependency. I'm saying this because the more dependencies we have the slower the project becomes. You can replace the backticks yourself by using https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll:
item.content.replaceAll('`', '')
☝️ this will replace all backticks with "nothing", i.e., will delete them.
Hope that helps!
Co-authored-by: Fran Méndez <fmvilas@gmail.com>
Co-authored-by: Fran Méndez <fmvilas@gmail.com>
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-1204--asyncapi-website.netlify.app/ |
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.
LGTM @Florence-Njeri. Approved ✔️. TOC
doesn't have backticks for the headers.
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.
THANK YOUUUU ✨✨✨
hey @fmvilas, we need your approval (or review) as we can't merge without it because you requested changes. ✌🏽 |
@fmvilas sir mister please approve as you are our almighty blocker here 😋 |
15d5e74
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.
LOL sorry, I don't know how I missed this SINCE FEBRUARY!!
/rtm |
@allcontributors please add @Florence-Njeri for code |
I've put up a pull request to add @Florence-Njeri! 🎉 |
Description
The generator docs render XML markup code snippets in the TOC. This PR sanitizes the headers before they are rendered in the TOC.
Related issue(s)
Fix Issue #1186