Skip to content

update: added html sanitizer for remote rendering - #1128

Merged
anikethsaha merged 3 commits into
docsifyjs:developfrom
anikethsaha:fix-validating-remote-content
Jun 17, 2020
Merged

update: added html sanitizer for remote rendering#1128
anikethsaha merged 3 commits into
docsifyjs:developfrom
anikethsaha:fix-validating-remote-content

Conversation

@anikethsaha

Copy link
Copy Markdown
Member

Summary
Added DOMPurifier for validating content coming from remote url
#1126

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of default theme, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
    You have tested in the following browsers: (Providing a detailed version will be better.)

  • Chrome

  • Firefox

  • Safari

  • Edge

  • IE

@anikethsaha

Copy link
Copy Markdown
MemberAuthor

cc @Sharifi-Amin

@anikethsaha
anikethsaha requested review from a team and QingWei-LiApril 21, 2020 10:16
Comment threadpackage.json
QingWei-Li
QingWei-Li previously approved these changes Apr 22, 2020
Comment threadpackages/docsify-server-renderer/index.js
Comment threadpackages/docsify-server-renderer/index.js

@trusktrtrusktr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hang on, I have an idea for isExternal.

Comment threadpackages/docsify-server-renderer/index.js
Comment threadpackages/docsify-server-renderer/index.js
Comment threadsrc/core/render/index.js Outdated
@trusktr

Copy link
Copy Markdown
Member

Ooops, let me fix lint errors.

@trusktr

Copy link
Copy Markdown
Member

There's also another isExternal check here:

constisExternal=/(?:http[s]?:)?\/\//.test(config.logo);

It should probably re-use the same trick.

@trusktrtrusktr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fixed my lint errors: anikethsaha#2

Comment threadpackages/docsify-server-renderer/index.js Outdated
Comment threadpackages/docsify-server-renderer/index.js Outdated
@anikethsaha

Copy link
Copy Markdown
MemberAuthor

cc @trusktr Update ?

@vercel

vercelBot commented May 21, 2020

Copy link
Copy Markdown

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/docsify-core/docsify-preview/3unan0xu1
✅ Preview: https://docsify-previe-git-fork-anikethsaha-fix-validating-remot-df5960.docsify-core.vercel.app

Comment threadsrc/core/render/index.js Outdated
@codesandbox-ci

codesandbox-ciBot commented Jun 14, 2020

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1d46637:

SandboxSource
priceless-night-80tqpConfiguration

@trusktrtrusktr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Needs tests. I'm adding some in my branch, currently in the tmp-update-server branch. I will make a better branch name before I'm make a PR to the main repo...

But for now, do you want to to merge this as is without tests? Or do you want to wait?

Personally I think we can get it merged, but not release yet.

@anikethsaha

anikethsaha commented Jun 17, 2020

Copy link
Copy Markdown
MemberAuthor

I will try to write tests for this. after that I guess we can merge it.

@anikethsaha
anikethsaha merged commit 714ef29 into docsifyjs:developJun 17, 2020
trusktr added a commit that referenced this pull request Jul 4, 2020
* develop:
docs: removed codefund docs and plugin (#1262)
docs: remove bundle size from the home page and documentation (#1257)
fix: search can not search the table header (#1256)
fix: after setting the background image, the button is obscured (#1234)
Fix: fixed onlycover flag in mobile (#1243)
fix: Updated docs with instructions for installing specific version (fixes#780) (#1225)
fix: Add error handling for missing dependencies (fixes#1210) (#1232)
[documdocs: deploy docsify in docker. (#1241)
docs: Add embed gist instructions to Embed Files (fixes#932 ) (#1238)
chore: add changelog 4.11.4
[build] 4.11.4
feat: added html sanitizer for remote rendering (#1128)
@jhildenbiddlejhildenbiddle mentioned this pull request Feb 5, 2021
7 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-patchThis needs a patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@anikethsaha@trusktr@QingWei-Li@sy-records