Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: apostrophecms/sanitize-html
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d7031b3ce21c7e5abb83e4027dca582da496b452
Choose a base ref
...
head repository: apostrophecms/sanitize-html
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8bce25160dab6396cd9c98b7bf490b7e64f35b21
Choose a head ref
  • 8 commits
  • 4 files changed
  • 2 contributors

Commits on Jul 3, 2020

  1. Drop chalk

    I didn't find this dependency is used anywhere.
    TrySound committed Jul 3, 2020
    Copy the full SHA
    6e6714e View commit details

Commits on Jul 6, 2020

  1. Update changelog

    TrySound committed Jul 6, 2020
    Copy the full SHA
    2384ed4 View commit details

Commits on Jul 7, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    aade3e0 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e93008f View commit details
  3. Merge pull request #373 from TrySound/drop-chalk

    Drop chalk
    abea authored Jul 7, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b906c54 View commit details
  4. Copy the full SHA
    7b116f6 View commit details
  5. Update changelog

    TrySound committed Jul 7, 2020
    Copy the full SHA
    1ac9306 View commit details
  6. Merge pull request #365 from TrySound/object-assign

    Replace xtend with builtin Object.assign
    abea authored Jul 7, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    8bce251 View commit details
Showing with 31 additions and 8 deletions.
  1. +21 −0 .github/stale.yml
  2. +5 −0 CHANGELOG.md
  3. +3 −5 package.json
  4. +2 −3 src/index.js
21 changes: 21 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
- documentation
- bug
- "v2"
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Changelog

1.27.1 (2020-07-15):
- Removes the unused chalk dependency.
- Adds configuration for a Github stale bot.
- Replace `xtend` package with native `Object.assign`.

1.27.0:
- Adds the `allowedIframeDomains` option. This works similar to `allowedIframeHostnames`, where you would set it to an array of web domains. It would then permit any hostname on those domains to be used in iframe `src` attributes. Thanks to [Stanislav Kravchenko](https://github.com/StanisLove) for the contribution.

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sanitize-html",
"version": "1.27.0",
"version": "1.27.1",
"description": "Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis",
"sideEffects": false,
"main": "dist/sanitize-html.js",
@@ -26,12 +26,10 @@
"author": "Apostrophe Technologies, Inc.",
"license": "MIT",
"dependencies": {
"chalk": "^2.4.1",
"htmlparser2": "^4.1.0",
"lodash": "^4.17.15",
"postcss": "^7.0.27",
"srcset": "^2.0.1",
"xtend": "^4.0.1"
"srcset": "^2.0.1"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
@@ -50,4 +48,4 @@
"sinon": "^9.0.2",
"uglify-js": "^3.8.0"
}
}
}
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable no-useless-escape */
var htmlparser = require('htmlparser2');
var extend = require('xtend');
var quoteRegexp = require('lodash/escapeRegExp');
var cloneDeep = require('lodash/cloneDeep');
var mergeWith = require('lodash/mergeWith');
@@ -101,9 +100,9 @@ function sanitizeHtml(html, options, _recursing) {
options = sanitizeHtml.defaults;
options.parser = htmlParserDefaults;
} else {
options = extend(sanitizeHtml.defaults, options);
options = Object.assign({}, sanitizeHtml.defaults, options);
if (options.parser) {
options.parser = extend(htmlParserDefaults, options.parser);
options.parser = Object.assign({}, htmlParserDefaults, options.parser);
} else {
options.parser = htmlParserDefaults;
}