0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-11 17:42:42 +00:00

Probably terrible solution

This commit is contained in:
G.Ambatte
2024-06-30 23:30:40 +12:00
parent 47b78510df
commit 5c2f603860
3 changed files with 15275 additions and 15266 deletions

View File

@@ -15,8 +15,17 @@ const Frame = require('react-frame-component').default;
const dedent = require('dedent-tabs').default; const dedent = require('dedent-tabs').default;
const { printCurrentBrew } = require('../../../shared/helpers.js'); const { printCurrentBrew } = require('../../../shared/helpers.js');
const DOMPurify = require('dompurify'); import DOMPurify from 'dompurify';
const purifyConfig = { FORCE_BODY: true, SANITIZE_DOM: false, ADD_ATTR: ['target'] };
const purifyConfig = {
ADD_ATTR : ['id', 'target'],
IGNORE_BASIC_CUSTOM_ELEMENT : true, // ignore the custom-element naming specification
CUSTOM_ELEMENT_HANDLING : {
tagNameCheck : ()=>{ return true; }, // all elements are allowed
attributeNameCheck : null, // default / standard attribute allow-list is used
allowCustomizedBuiltInElements : false, // no customized built-ins allowed
},
};
const Themes = require('themes/themes.json'); const Themes = require('themes/themes.json');

18
package-lock.json generated
View File

@@ -21,7 +21,7 @@
"cookie-parser": "^1.4.6", "cookie-parser": "^1.4.6",
"create-react-class": "^15.7.0", "create-react-class": "^15.7.0",
"dedent-tabs": "^0.10.3", "dedent-tabs": "^0.10.3",
"dompurify": "^3.1.5", "dompurify": "git+https://github.com/G-Ambatte/DOMPurify.git#AddConfigOption-IGNORE_BASIC_CUSTOM_ELEMENT",
"expr-eval": "^2.0.2", "expr-eval": "^2.0.2",
"express": "^4.19.2", "express": "^4.19.2",
"express-async-handler": "^1.2.0", "express-async-handler": "^1.2.0",
@@ -5469,8 +5469,8 @@
}, },
"node_modules/dompurify": { "node_modules/dompurify": {
"version": "3.1.5", "version": "3.1.5",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.5.tgz", "resolved": "git+ssh://git@github.com/G-Ambatte/DOMPurify.git#b6cc41ec10b6fb6de17b29015ea0718eccd752f9",
"integrity": "sha512-lwG+n5h8QNpxtyrJW/gJWckL+1/DQiYMX8f7t8Z2AZTPw1esVrqjI63i7Zc2Gz0aKzLVMYC1V1PL/ky+aY/NgA==" "license": "(MPL-2.0 OR Apache-2.0)"
}, },
"node_modules/duplexer2": { "node_modules/duplexer2": {
"version": "0.1.4", "version": "0.1.4",
@@ -7288,9 +7288,9 @@
"integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==" "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg=="
}, },
"node_modules/https-proxy-agent": { "node_modules/https-proxy-agent": {
"version": "7.0.2", "version": "7.0.5",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz",
"integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==",
"dependencies": { "dependencies": {
"agent-base": "^7.0.2", "agent-base": "^7.0.2",
"debug": "4" "debug": "4"
@@ -11925,9 +11925,9 @@
"integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="
}, },
"node_modules/punycode": { "node_modules/punycode": {
"version": "2.3.0", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"engines": { "engines": {
"node": ">=6" "node": ">=6"
} }

View File

@@ -93,7 +93,7 @@
"cookie-parser": "^1.4.6", "cookie-parser": "^1.4.6",
"create-react-class": "^15.7.0", "create-react-class": "^15.7.0",
"dedent-tabs": "^0.10.3", "dedent-tabs": "^0.10.3",
"dompurify": "^3.1.5", "dompurify": "git+https://github.com/G-Ambatte/DOMPurify.git#AddConfigOption-IGNORE_BASIC_CUSTOM_ELEMENT",
"expr-eval": "^2.0.2", "expr-eval": "^2.0.2",
"express": "^4.19.2", "express": "^4.19.2",
"express-async-handler": "^1.2.0", "express-async-handler": "^1.2.0",