diff options
Diffstat (limited to 'feed/note-page.js')
| -rw-r--r-- | feed/note-page.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/feed/note-page.js b/feed/note-page.js index f4dc08e..3145f14 100644 --- a/feed/note-page.js +++ b/feed/note-page.js @@ -117,9 +117,9 @@ export function createThreadCache({ build, now = Date.now }) { return { get, refresh }; } -const esc = (s) => String(s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c])); +export const esc = (s) => String(s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c])); // JSON inside a script tag: nothing in it may close the tag or open a comment -const scriptJson = (v) => JSON.stringify(v).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); +export const scriptJson = (v) => JSON.stringify(v).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); function nameOf(data, pk) { const p = (data.profiles || []).find((e) => e.pubkey === pk); |
