@cocreate/utils 1.16.5 → 1.17.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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/utils.js +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.17.0](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.16.5...v1.17.0) (2022-12-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* escapeHthml function ([ef5359b](https://github.com/CoCreate-app/CoCreate-utils/commit/ef5359b511351b47803674e9ebde3532620313e1))
|
|
7
|
+
|
|
1
8
|
## [1.16.5](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.16.4...v1.16.5) (2022-12-15)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/utils.js
CHANGED
|
@@ -138,6 +138,10 @@
|
|
|
138
138
|
else return doc.body.children[0];
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
function escapeHtml(html) {
|
|
142
|
+
return html.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll("'", ''').replaceAll('"', '"');
|
|
143
|
+
}
|
|
144
|
+
|
|
141
145
|
function cssPath(node, container) {
|
|
142
146
|
let pathSplits = [];
|
|
143
147
|
do {
|
|
@@ -567,6 +571,7 @@
|
|
|
567
571
|
getValueFromObject,
|
|
568
572
|
domParser,
|
|
569
573
|
parseTextToHtml,
|
|
574
|
+
escapeHtml,
|
|
570
575
|
cssPath,
|
|
571
576
|
queryDocumentSelector,
|
|
572
577
|
queryDocumentSelectorAll,
|