Skip to content

Commit

Permalink
html: reexpose HTML escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
terrablue committed Aug 10, 2024
1 parent bd6e1c3 commit b2f2513
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
"runtime": "./src/public/runtime.js",
"default": "./src/public/default.js"
},
"./handler": "./src/public/handler.js"
"./*": "./src/public/*.js"
}
}
4 changes: 2 additions & 2 deletions packages/html/src/private/build/server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default text => `import HTML from "@rcompat/string/HTML";
export default text => `import HTML from "@primate/html/escape";
export default (props = {}, options) => {
const encoded = JSON.parse(HTML.escape(JSON.stringify(props)));
const encoded = JSON.parse(escape(JSON.stringify(props)));
const keys = Object.keys(encoded);
const values = Object.values(encoded);
const text = ${JSON.stringify(text)};
Expand Down
1 change: 1 addition & 0 deletions packages/html/src/public/escape.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "@rcompat/string/HTML";

0 comments on commit b2f2513

Please sign in to comment.