@happeouikit/content-renderer 3.5.7 → 3.6.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  import { decode as decodeHtmlEntities } from "html-entities";
2
2
  /**
3
3
  * @name toSafeText
4
- * @description Returns filtered text with filterXSS library
4
+ * @description Returns filtered text, sanitized with DOMPurify against the
5
+ * safeTagsAndAttributes allow-list (see registerSanitizeHooks for
6
+ * the per-tag attribute and CSS-property restrictions layered on
7
+ * top of DOMPurify's own tag/attribute/URL-scheme filtering)
5
8
  * @author Antero Hanhirova
6
9
  * @param {String} - Text to whitelist
7
10
  * @returns {String}
@@ -19,7 +22,7 @@ declare const addColorSpanAfterColorCodes: (text?: string) => string;
19
22
  * @param {String} - Markdown
20
23
  * @returns {String} - Html
21
24
  */
22
- declare const toHtml: (str?: string, type?: string) => any;
25
+ declare const toHtml: (str?: string, type?: string) => string;
23
26
  declare const loadCodeFont: () => void;
24
27
  declare const getNearestRelativeParent: (el: HTMLElement) => HTMLElement | null;
25
28
  declare const removeSpecialCharacters: (str?: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happeouikit/content-renderer",
3
- "version": "3.5.7",
3
+ "version": "3.6.1-alpha.0",
4
4
  "description": "Rendering html and markdown content",
5
5
  "type": "module",
6
6
  "jsnext:main": "dist/index.es.js",
@@ -16,13 +16,13 @@
16
16
  "author": "Happeo Oy",
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
+ "dompurify": "3.4.11",
19
20
  "html-entities": "^2.3.2",
20
21
  "linkify-html": "^4.1.3",
21
22
  "linkifyjs": "^4.1.3",
22
23
  "loadjs": "^4.3.0",
23
24
  "react-dom": "^18.0.0",
24
- "showdown": "^2.1.0",
25
- "xss": "^1.0.15"
25
+ "showdown": "^2.1.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@happeouikit/copy-to-clipboard-button": "^3.0.0",
@@ -38,6 +38,5 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/loadjs": "^4.0.4"
41
- },
42
- "gitHead": "fe0ef0912436ca1e514eb442c91e1075948894e7"
41
+ }
43
42
  }