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

update: added html sanitizer for remote rendering #1128

Merged

Conversation

anikethsaha
Copy link
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
Member Author

cc @Sharifi-Amin

@anikethsaha anikethsaha requested review from QingWei-Li and a team April 21, 2020 10:16
QingWei-Li
QingWei-Li previously approved these changes Apr 22, 2020
Copy link
Member

@trusktr trusktr left a comment

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.

src/core/render/index.js Outdated Show resolved Hide resolved
@trusktr
Copy link
Member

trusktr commented Apr 26, 2020

Ooops, let me fix lint errors.

@trusktr
Copy link
Member

trusktr commented Apr 26, 2020

There's also another isExternal check here:

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

It should probably re-use the same trick.

Copy link
Member

@trusktr trusktr left a comment

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

@anikethsaha
Copy link
Member Author

cc @trusktr Update ?

@vercel
Copy link

vercel bot commented May 21, 2020

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

src/core/render/index.js Outdated Show resolved Hide resolved
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 14, 2020

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:

Sandbox Source
priceless-night-80tqp Configuration

Copy link
Member

@trusktr trusktr left a comment

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
Copy link
Member Author

anikethsaha commented Jun 17, 2020

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

@anikethsaha anikethsaha merged commit 714ef29 into docsifyjs:develop Jun 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)
@jhildenbiddle jhildenbiddle mentioned this pull request Feb 5, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch This needs a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants