rapier-html 1.1.64 → 1.1.73

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/dist/wrap.mjs CHANGED
@@ -5,18 +5,18 @@ import {PAGE_SEED, returnAddress, returnExpiresAt} from './return-address.mjs';
5
5
 
6
6
  const START = '<script type="text/markdown" id="rapier-document"';
7
7
  const DRAWING_START = '<script type="text/plain" id="rapier-drawing"';
8
- // The text the document was proposed against (docs/page-door.md, "2. A change carried"): the page opens on its diff.
8
+ // The text the document was proposed against: the page opens on its diff.
9
9
  const END = '</script>';
10
10
  // The page's search words (rapier.html's RAPIER_SEO regions: description, canonical address, previews, structured data and the plain guide
11
11
  // a crawler reads) are rapier.website's own. A page that carries someone's document never claims that address or that description.
12
12
  const SEARCH_WORDS = /<!-- RAPIER_SEO_BEGIN -->[\s\S]*?<!-- RAPIER_SEO_END -->\n?/g;
13
13
 
14
- // One encoding, exactly reversible (docs/page-door.md, "What a block may hold"): no `<` before `/` or `!`, no CR, no NUL.
15
- // engine.js _rapierDecodeCarried is its inverse.
14
+ // One encoding, exactly reversible: no `<` before `/` or `!`, no CR, no NUL. engine.js _rapierDecodeCarried is its
15
+ // inverse.
16
16
  export {encodeCarried, decodeCarried};
17
17
 
18
18
  function safeName(name, fallback) {
19
- return String(name || fallback).replace(/[\\/\0"<>&]/g, '-').slice(0, 255) || fallback;
19
+ return String(name || fallback).replace(/[\\/\0"<>&]/g, '-').slice(0, 255).replace(/[\uD800-\uDBFF]$/, '') || fallback;
20
20
  }
21
21
 
22
22
  export function wrap(pageHtml, text, name, options) {
@@ -27,7 +27,7 @@ export function wrap(pageHtml, text, name, options) {
27
27
  const previous = unwrap(pageHtml);
28
28
  const opts = {...saved, ...(options || {})};
29
29
  const docName = safeName(name, 'document.md');
30
- // `view`: the view the page opens on with the document behind it, `draw` or `notes` (docs/page-door.md).
30
+ // `view`: the view the page opens on with the document behind it, `draw` or `notes`.
31
31
  if (opts.view != null && !['draw', 'notes'].includes(opts.view)) throw new Error('the view is draw or notes');
32
32
  const address = opts.return == null ? null : returnAddress(opts.return);
33
33
  const expiry = opts.return_expires_at == null ? null : returnExpiresAt(opts.return_expires_at);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rapier-html",
3
- "version": "1.1.64",
3
+ "version": "1.1.73",
4
4
  "description": "Give a person a document they can read, edit and keep: one command writes one offline HTML file that is the whole Markdown editor with the document inside; draw, paint, review a diff, Send back to the agent.",
5
5
  "keywords": [
6
6
  "markdown",