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

Allow GitHub HTML tags in Markdown #1003

Merged
merged 2 commits into from Nov 15, 2018

Conversation

Projects
None yet
2 participants
@vinkla
Contributor

vinkla commented Nov 14, 2018

Description of the Change

This pull request adds support for HTML tags in the description field. Only HTML tags in gfm (GitHub Flavored Markdown) are valid. This approach is heavily based on this piece of code:

https://github.com/sourcegraph/codeintellify/blob/5eef578cfc508dbcc6a97f5ba08675768b0a5187/src/helpers.ts#L90-L102

Alternate Designs

Using the dompurify package instead of the sanitize-html package to be consistent with markdown-preview for example.

Benefits

The description text in the LSP package ide-php contains HTML. This package currently sanitize the HTML which makes the description look like this:

With this update the description will instead look like this:

Possible Drawbacks

N/A

Applicable Issues

Microsoft/vscode#40607
felixfbecker/php-language-server#674
felixfbecker/php-language-server#288

@damieng

This comment has been minimized.

Contributor

damieng commented Nov 15, 2018

I think DomPurify would be preferred given it's already used in a bunch of core Atom packages for this (Markdown-Preview, Settings-View etc).

@vinkla

This comment has been minimized.

Contributor

vinkla commented Nov 15, 2018

I've pushed an update switching from the sanitize-html to the dompurify package.

@damieng

This comment has been minimized.

Contributor

damieng commented Nov 15, 2018

Wondering if that breaks: true is going to negatively impact other users of autocomplete-plus... Any thoughts @lee-dohm ?

@vinkla

This comment has been minimized.

Contributor

vinkla commented Nov 15, 2018

From the documentation for reference:

If true, use GFM hard and soft line breaks. Requires gfm be true.

@damieng damieng merged commit f3fa5d4 into atom:master Nov 15, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@vinkla vinkla deleted the vinkla:sanitize-html branch Nov 15, 2018

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