Skip to content
This repository was archived by the owner on Nov 25, 2021. It is now read-only.

Conversation

@yevbar
Copy link
Contributor

@yevbar yevbar commented Dec 21, 2018

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.

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.
@yevbar
Copy link
Contributor Author

yevbar commented Dec 21, 2018

As context, here is the original issue I filed
https://github.com/sourcegraph/sourcegraph/issues/1477

@codecov
Copy link

codecov bot commented Dec 21, 2018

Codecov Report

Merging #83 into master will increase coverage by 4.18%.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/helpers.ts 75% <ø> (+7.5%) ⬆️
src/token_position.ts 91.94% <0%> (+0.67%) ⬆️
src/hoverifier.ts 76.34% <0%> (+11.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a327422...cf296c7. Read the comment docs.

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'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@felixfbecker felixfbecker merged commit 1836363 into sourcegraph:master Dec 21, 2018
@sourcegraph-bot
Copy link

🎉 This PR is included in version 5.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants