Skip to content

Commit

Permalink
htmx: reexpose HTML escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
terrablue committed Aug 10, 2024
1 parent 6f678b7 commit 7bce852
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/htmx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@primate/htmx",
"version": "0.19.2",
"version": "0.19.3",
"description": "Primate HTMX frontend",
"homepage": "https://primatejs.com/modules/htmx",
"bugs": "https://github.com/primatejs/primate/issues",
Expand Down Expand Up @@ -47,6 +47,7 @@
".": {
"runtime": "./src/public/runtime.js",
"default": "./src/public/default.js"
}
},
"./*": "./src/public/*.js"
}
}
4 changes: 2 additions & 2 deletions packages/htmx/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 escape from "@primate/htmx/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/htmx/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 7bce852

Please sign in to comment.