Skip to content
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

chore: Remove dompurify #1490

Merged
merged 45 commits into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
51bb968
Remove domputify (client-side)
jhildenbiddle Feb 5, 2021
936d566
Render native emoji with image fallback
jhildenbiddle Feb 4, 2022
e7d627a
Deprecate emoji plugin
jhildenbiddle Feb 4, 2022
db1e94e
Add emoji tests
jhildenbiddle Feb 4, 2022
1fa45e5
Remove console.log statement
jhildenbiddle Feb 4, 2022
8252f3a
Fix emoji image alt attribute
jhildenbiddle Feb 4, 2022
b8c227f
Set nativeEmoji to false by default (non-breaking)
jhildenbiddle Feb 4, 2022
d03aa4f
Fix parsing emoji in HTML comments and script tags
jhildenbiddle Feb 4, 2022
39d5204
Add nativeEmoji and update noEmoji details
jhildenbiddle Feb 4, 2022
baf8044
Add Emoji plugin deprecation notice
jhildenbiddle Feb 5, 2022
39bf522
Fix ESLint issues
jhildenbiddle Feb 5, 2022
e1e8d22
Create build:emoji task
jhildenbiddle Feb 5, 2022
8c10b5f
Fix rendering of GitHub emoji without unicode
jhildenbiddle Feb 5, 2022
208049b
Adjust and match size of native and image emoji
jhildenbiddle Feb 5, 2022
b7a3b67
Update emoji test snapshot
jhildenbiddle Feb 5, 2022
260992c
Update docs test snapshot
jhildenbiddle Feb 5, 2022
2079441
Merge branch 'develop' into feat-native-emoji
Koooooo-7 Feb 5, 2022
8b587b8
Fix ci/codesandbox error
jhildenbiddle Feb 5, 2022
53d5fb5
Update native emoji font-stack
jhildenbiddle Feb 6, 2022
e9d5722
Fix rendering of native multi-character emoji
jhildenbiddle Feb 6, 2022
7c15fd7
Kick GitHub Workflow
jhildenbiddle Feb 6, 2022
05c7974
Merge branch 'develop' into feat-native-emoji
jhildenbiddle Mar 4, 2022
7ba8513
Replace rollup’s uglify plugin with terser
jhildenbiddle Mar 4, 2022
d52b476
Switch “npm ci” instead of “npm i” for stability
jhildenbiddle Mar 4, 2022
3f2dd46
Change emoji data from default to named export
jhildenbiddle Mar 4, 2022
e06fed4
Revert "Replace rollup’s uglify plugin with terser"
jhildenbiddle Mar 4, 2022
77cb0cd
Revert "Switch “npm ci” instead of “npm i” for stability"
jhildenbiddle Mar 4, 2022
98185ca
Revert "Change emoji data from default to named export"
jhildenbiddle Mar 4, 2022
bec3e0d
Specify codesandbox template and node version
jhildenbiddle Mar 4, 2022
16aec44
Update codesandbox config
jhildenbiddle Mar 4, 2022
27d4952
Revert "Revert "Replace rollup’s uglify plugin with terser""
jhildenbiddle Mar 4, 2022
4208c82
Revert "Revert "Revert "Replace rollup’s uglify plugin with terser"""
jhildenbiddle Mar 4, 2022
5120dd2
Update codesandbox config
jhildenbiddle Mar 4, 2022
8cdf27e
Revert "Update codesandbox config"
jhildenbiddle Mar 4, 2022
9d522d5
Fix codesandbox uglify error
jhildenbiddle Mar 4, 2022
ddf7ad2
Emoji docs tweaks
jhildenbiddle Mar 5, 2022
da6480d
Restore and update emoji plugin code
jhildenbiddle Mar 5, 2022
4a1d87e
Restore and update emoji plugin docs
jhildenbiddle Mar 5, 2022
d9fc279
Prettier updates
jhildenbiddle Mar 5, 2022
af45845
Match lowercase shortcodes only
jhildenbiddle Mar 5, 2022
6dea645
Merge branch 'feat-native-emoji' into remove-dompurify
jhildenbiddle Mar 6, 2022
8185ebf
Merge branch 'develop' into remove-dompurify
jhildenbiddle Mar 6, 2022
8a532b8
Remove DOMPurify
jhildenbiddle Mar 6, 2022
a52dfd9
Remove DOMPurify from docsify-server-renderer
jhildenbiddle Mar 6, 2022
f95c40f
Merge branch 'develop' into remove-dompurify
jhildenbiddle Mar 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"*.js": "eslint --fix"
},
"dependencies": {
"dompurify": "^2.3.1",
"marked": "^1.2.9",
"medium-zoom": "^1.0.6",
"opencollective-postinstall": "^2.0.2",
Expand Down
7 changes: 3 additions & 4 deletions packages/docsify-server-renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { resolve, basename } from 'path';
import resolvePathname from 'resolve-pathname';
import fetch from 'node-fetch';
import debug from 'debug';
import DOMPurify from 'dompurify';
import { AbstractHistory } from '../../src/core/router/history/abstract';
import { Compiler } from '../../src/core/render/compiler';
import { isAbsolutePath } from '../../src/core/router/util';
Expand Down Expand Up @@ -123,10 +122,10 @@ export default class Renderer {
this._renderHtml('cover', await this._render(coverFile), 'cover');
}

const html = this.isRemoteUrl
? DOMPurify.sanitize(this.html, { ADD_TAGS: ['script'] })
: this.html;
const html = this.html;

this.html = this.template;

return html;
}

Expand Down
Loading