-
Notifications
You must be signed in to change notification settings - Fork 6
Add allowed tags and attributes for extensions #83
Conversation
The markdown is passed to [marked](https://marked.js.org/) and then to [sanitize-html](https://www.npmjs.com/package/sanitize-html). In order to get the needed tags, I put my needed markdown into [marked's demo](https://marked.js.org/demo) and looked at the HTML they provided.
|
As context, here is the original issue I filed |
Compared to [https://github.com/sourcegraph/codeintellify/blob/a3274229d34c72e0ad3a128f60a2065e7b1015ff/src/helpers.ts#L108](https://github.com/sourcegraph/codeintellify/blob/a3274229d34c72e0ad3a128f60a2065e7b1015ff/src/helpers.ts#L108) and added comma (Travis broke on prettier)
Codecov Report
@@ Coverage Diff @@
## master #83 +/- ##
==========================================
+ Coverage 72.83% 77.01% +4.18%
==========================================
Files 14 14
Lines 611 609 -2
Branches 165 168 +3
==========================================
+ Hits 445 469 +24
+ Misses 166 140 -26
Continue to review full report at Codecov.
|
src/helpers.ts
Outdated
| // <span class="hljs-keyword"> | ||
| // <code class="language-javascript"> | ||
| allowedTags: [...sanitize.defaults.allowedTags, 'span'], | ||
| allowedTags: [...sanitize.defaults.allowedTags, 'span', 'h4', 'a', 'p', 'strong', 'details', 'summary'], |
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.
| allowedTags: [...sanitize.defaults.allowedTags, 'span', 'h4', 'a', 'p', 'strong', 'details', 'summary'], | |
| allowedTags: [...sanitize.defaults.allowedTags, 'span', 'details', 'summary'], |
h4, p, strong are all already in defaults.allowedTags: https://sourcegraph.com/github.com/punkave/sanitize-html/-/blob/src/index.js#L572
|
🎉 This PR is included in version 5.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The markdown is passed to marked and then to sanitize-html. In order to get the needed tags, I put my needed markdown into marked's demo and looked at the HTML they provided.