domma-cms 0.14.0 → 0.14.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-cms",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
5
5
  "type": "module",
6
6
  "main": "server/server.js",
@@ -647,12 +647,14 @@ async function processCollectionBlocks(markdown) {
647
647
  */
648
648
  export function parseShortcodeAttrs(attrStr) {
649
649
  const attrs = {};
650
- // Pass 1: quoted key="value" or key='value' pairs
651
- for (const [, key, val] of attrStr.matchAll(/([\w-]+)=["']([^"']*)["']/g)) {
652
- attrs[key] = val;
650
+ // Pass 1: quoted key="value" or key='value' pairs — proper disjunction so
651
+ // a double-quoted value can contain apostrophes (and vice versa) without
652
+ // the opposite quote terminating the match.
653
+ for (const [, key, dq, sq] of attrStr.matchAll(/([\w-]+)=(?:"([^"]*)"|'([^']*)')/g)) {
654
+ attrs[key] = dq ?? sq ?? '';
653
655
  }
654
656
  // Pass 2: standalone flag attributes (no value) — blank out key=value matches first
655
- const stripped = attrStr.replace(/([\w-]+)=["'][^"']*["']/g, m => ' '.repeat(m.length));
657
+ const stripped = attrStr.replace(/([\w-]+)=(?:"[^"]*"|'[^']*')/g, m => ' '.repeat(m.length));
656
658
  for (const [, key] of stripped.matchAll(/\b([\w-]+)\b/g)) {
657
659
  if (!(key in attrs)) attrs[key] = true;
658
660
  }