domma-cms 1.44.0 → 1.44.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/CHANGELOG.md +4 -0
- package/docs/DommaFeatures.md +4 -2
- package/package.json +1 -1
- package/server/services/markdown.js +64 -41
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.44.1] - 2026-11-08
|
|
4
|
+
|
|
5
|
+
- **A shortcode inside an effect, tabs or an accordion keeps its settings.** `[reveal]`, `[ambient]` and the other effects, `[tabs]`, `[accordion]`, `[carousel]` and the cards render their body before the shortcodes inside it run, and that turned the inner tag's quotes into `"` and its web addresses into links. So `[hero size="md"]` inside `[reveal]` got the class `hero-"md"`, `[embed url="https://…"]` said "Invalid embed URL", and `[spacer size="24" /]` was drawn at the default 40px. Tags with settings are now held back from that pass and put back as written (`markedBody()` in markdown.js). Effects also escape their own `data-fx-*` values.
|
|
6
|
+
|
|
3
7
|
## [1.44.0] - 2026-11-08
|
|
4
8
|
|
|
5
9
|
- **New self-hosted sites look like domma-cms.com.** What `npx domma-cms <name>` makes:
|
package/docs/DommaFeatures.md
CHANGED
|
@@ -74,7 +74,7 @@ Code was treated as the truth. Where docs disagree with it, the disagreement is
|
|
|
74
74
|
| `shopping-cart-pro` | paid | 0.3.2 | More for the Shop: discount codes (other Tools such as Prize Wheel can make single-use ones), shipping zones with rates by weight or order value, tax by country and class, branded order emails from confirmation to dispatch, and Insights - takings by week, best sellers, repeat customers and abandoned checkouts you can nudge. Adds to the free Shopping Cart; a lapsed licence leaves the Cart and every order just as they were. |
|
|
75
75
|
| `sliding-puzzle` | paid (giftable) | 1.0.0 | The tile-sliding puzzle, 3x3 to 6x6, numbers or a Media picture. Same board for everyone, a new board each go, or a daily puzzle; every move checked by the server. Fewest moves or fastest time wins. |
|
|
76
76
|
| `social-media-pro` | paid | 0.4.0 | How the site looks when it is shared, and posting it: share cards per page for Facebook, X, LinkedIn, WhatsApp and Slack with previews; a share image drawn for every page that has none, in the site's colours; share and follow buttons; posting to Bluesky, Mastodon and LinkedIn (through the site's own LinkedIn app, with a reminder before its 60-day sign-in runs out) - now, scheduled, or drafted automatically for every new blog post or page - with links tagged for Analytics and the posts on the Calendar; and LinkedIn conversions - chosen forms reported to LinkedIn's Conversions API when a visitor who accepted marketing cookies sends one. Sold with SEO Pro. |
|
|
77
|
-
| `surveys` | paid | 1.
|
|
77
|
+
| `surveys` | paid | 1.10.0 | Targeted surveys over the Forms engine: shared audiences, tokenised invites, reminders, and per-survey statistics. |
|
|
78
78
|
| `sweepstake` | paid (giftable) | 1.0.0 | Office, pub and club sweepstakes for any event: picks, entry fee and prizes, entrants by name with paid ticks, and one recorded, repeatable draw revealed live on the page, then who has what and the money. |
|
|
79
79
|
| `theme-roller` | paid | 1.1.3 | Make your own themes: start from any built-in theme, change its colours, fonts, spacing and borders with a live preview, and save it. Saved themes join the built-in ones everywhere a theme is chosen - the site, the admin, day and night, a region of a page. Needs Domma CMS 0.73 or later to use them. |
|
|
80
80
|
| `timeline` | paid (giftable) | 1.0.0 | Put events in date order: all at once (Sort) or one at a time into a growing timeline with lives (Place). Years, months or full dates, BC too; dates stay on the server until a card is placed. Shortcode `[timeline-game]`. |
|
|
@@ -2399,7 +2399,7 @@ Control how every page looks when it is shared, and post it. Social Media Pro ed
|
|
|
2399
2399
|
|
|
2400
2400
|
### Surveys (`surveys`)
|
|
2401
2401
|
|
|
2402
|
-
Tier: paid (closed source) · Version: 1.
|
|
2402
|
+
Tier: paid (closed source) · Version: 1.10.0 · Requires: nothing declared; collections declare MongoDB (`storage.adapter: "mongodb"`) and fall back to files when `config/connections.json` is absent · Uses: `contacts` ("Import an audience from Contacts"); notes say core 0.88 · Built over core Forms
|
|
2403
2403
|
|
|
2404
2404
|
Targeted surveys on top of the Forms engine. Pick any form, choose an audience from your own contact list and groups, send tokenised email invitations and reminders, and watch response rates and per-question statistics - identified or anonymous. Surveys can also be embedded in any page or opened from a hosted survey page with a code.
|
|
2405
2405
|
|
|
@@ -2411,6 +2411,8 @@ Targeted surveys on top of the Forms engine. Pick any form, choose an audience f
|
|
|
2411
2411
|
- Hosted page `/survey/:slug` (token in `?t=` or typed code), 404 unknown / 403 before its Opens day / 410 closed; submit at `POST /api/plugins/surveys/submit/:slug`.
|
|
2412
2412
|
- **Theme per survey (1.9.0)** - Survey page > Theme picks the hosted page's colour theme (any built-in palette or a Theme Roller custom theme); "Use site theme" follows Content > Theme. Before 1.9.0 the hosted page ignored the site theme entirely. Embeds take the host page's theme. Stored as `theme` on the survey (theme id or blank) and carried by JSON export/import.
|
|
2413
2413
|
- **Wizard steps scroll to the top (1.9.0)** - Next, Back and logic step jumps on a multi-page survey jump to the top of the hosted page, or to the top of an embedded survey (clear of a sticky navbar), so the next step starts at its first question.
|
|
2414
|
+
- **Results by section and view switches (1.10.0)** - Results' Show card: Split into sections (the form's wizard pages, each with title, description and "N questions · M answered", plus Jump to buttons), Hide questions nobody answered, Show free-text answers. Kept on the survey (`results`), `PUT /api/plugins/surveys/surveys/:slug/results-view`; the cog's Split results into sections (`resultsBySection`, on) is the starting point. Read-only users' flips stay on screen only.
|
|
2415
|
+
- **Results exports (1.10.0)** - Export JSON is a full report (`format: domma-surveys-results`, v1: survey, summary, sections or questions with counts/percentages/averages, every response keyed by question label) instead of a bare array of rows. Export CSV adds Submitted and heads columns with question labels (`Section: Question` when split); headings are formula-defused like cells.
|
|
2414
2416
|
- Opens/Closes are days in the site's time zone (`timeZone` setting, default `Europe/London`): a survey takes answers from the start of its Opens day to the END of its Closes day. The hosted page, submissions, scheduler reminders, Send (409 once closed), the list chip, the badge and the closing notices all use the same rule (1.4.4).
|
|
2415
2417
|
- Shortcode `[survey slug="..." /]` - embeds the survey on any page; Copy embed shortcode copies exactly this, and the page gets the survey script added automatically (1.4.4).
|
|
2416
2418
|
- Results (`#/plugins/surveys/results/:slug`): invited, answered, response rate, per-question aggregates (only this survey's responses, tagged `survey:<slug>`); Export CSV and Export JSON; anonymous flag.
|
package/package.json
CHANGED
|
@@ -2097,6 +2097,29 @@ export function scrubCodeRegions(markdown, preserveIndented = false) {
|
|
|
2097
2097
|
return {scrubbed, restore};
|
|
2098
2098
|
}
|
|
2099
2099
|
|
|
2100
|
+
/**
|
|
2101
|
+
* marked.parse for a shortcode's BODY while later shortcodes inside it have not
|
|
2102
|
+
* run yet. Marked reads their tags as text: quotes become " and a URL turns
|
|
2103
|
+
* into a link, so [hero size="md"] inside [reveal] (or [tabs], [accordion], ...)
|
|
2104
|
+
* reached the hero as size="md" - class hero-"md" - and an
|
|
2105
|
+
* [embed url="https://..."] arrived as an <a> tag and was refused. Every tag
|
|
2106
|
+
* that carries attributes is held out of marked and put back exactly as written;
|
|
2107
|
+
* code spans and fences are left to marked, so an example tag there still shows
|
|
2108
|
+
* as code. Bare tags ([/hero], [center]) are left alone - marked does not change them.
|
|
2109
|
+
*/
|
|
2110
|
+
let shieldCallId = 0;
|
|
2111
|
+
const ATTR_TAG = /\[\/?[a-z][\w-]*\s[^\]\n]*=[^\]\n]*\](?![(\[:])/gi;
|
|
2112
|
+
function markedBody(md) {
|
|
2113
|
+
const text = String(md ?? '');
|
|
2114
|
+
if (!text.includes('=')) return marked.parse(text);
|
|
2115
|
+
const id = ++shieldCallId;
|
|
2116
|
+
const held = [];
|
|
2117
|
+
const {scrubbed, restore} = scrubCodeRegions(text);
|
|
2118
|
+
const shielded = restore(scrubbed.replace(ATTR_TAG, (tag) => { held.push(tag); return `DMSCT${id}x${held.length - 1}x`; }));
|
|
2119
|
+
if (!held.length) return marked.parse(text);
|
|
2120
|
+
return marked.parse(shielded).replace(new RegExp(`DMSCT${id}x(\\d+)x`, 'g'), (_, i) => held[Number(i)]);
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2100
2123
|
/**
|
|
2101
2124
|
* Run all plugin-registered shortcode handlers against the markdown string.
|
|
2102
2125
|
* Self-closing ([name attrs /]) and wrapping ([name attrs]...[/name]) forms are both supported.
|
|
@@ -2229,7 +2252,7 @@ function processEffectsBlocks(markdown) {
|
|
|
2229
2252
|
// Native hover fireworks need a hit target; the base decoration ignores pointer events.
|
|
2230
2253
|
const style = hover ? ' style="pointer-events:auto;--dm-fw-size:var(--dm-fw-particle-size)"' : '';
|
|
2231
2254
|
const particles = hover ? '' : '<div class="firework-launch"></div><div class="firework-particles"></div>';
|
|
2232
|
-
const innerHtml = body === null ? '' :
|
|
2255
|
+
const innerHtml = body === null ? '' : markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))));
|
|
2233
2256
|
return `<div class="${classes.join(' ')}"${style}>${particles}${innerHtml}</div>\n`;
|
|
2234
2257
|
});
|
|
2235
2258
|
|
|
@@ -2253,7 +2276,7 @@ function processEffectsBlocks(markdown) {
|
|
|
2253
2276
|
if (!hasActions) {
|
|
2254
2277
|
// Restore code placeholders before the nested parse (tabs-handler
|
|
2255
2278
|
// pattern) so code spans/fences render as <code>, not raw backticks.
|
|
2256
|
-
const innerHtml =
|
|
2279
|
+
const innerHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))));
|
|
2257
2280
|
return `<div class="dm-fx-scribe"${dataAttrs}${styleAttrs}>${innerHtml}</div>\n`;
|
|
2258
2281
|
}
|
|
2259
2282
|
const actions = [];
|
|
@@ -2290,10 +2313,10 @@ function processEffectsBlocks(markdown) {
|
|
|
2290
2313
|
apply(name, (attrStr, body) => {
|
|
2291
2314
|
if (body === null) return '';
|
|
2292
2315
|
const attrs = parseShortcodeAttrs(attrStr);
|
|
2293
|
-
const dataAttrs = Object.entries(attrs).map(([k, v]) => ` data-fx-${k}="${v}"`).join('');
|
|
2316
|
+
const dataAttrs = Object.entries(attrs).map(([k, v]) => ` data-fx-${k}="${escapeAttr(String(v))}"`).join('');
|
|
2294
2317
|
// Restore code placeholders before the nested parse (tabs-handler
|
|
2295
2318
|
// pattern) so code spans/fences render as <code>, not raw backticks.
|
|
2296
|
-
const innerHtml =
|
|
2319
|
+
const innerHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))));
|
|
2297
2320
|
return `<div class="dm-fx-${name}"${dataAttrs}>${innerHtml}</div>\n`;
|
|
2298
2321
|
});
|
|
2299
2322
|
}
|
|
@@ -2310,7 +2333,7 @@ function processEffectsBlocks(markdown) {
|
|
|
2310
2333
|
}
|
|
2311
2334
|
// Restore code placeholders before the nested parse (tabs-handler
|
|
2312
2335
|
// pattern) so code spans/fences render as <code>, not raw backticks.
|
|
2313
|
-
const innerHtml =
|
|
2336
|
+
const innerHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))));
|
|
2314
2337
|
return `<div class="dm-fx-ticker-tape" data-fx-mode="container"${dataAttrs}>${innerHtml}</div>\n`;
|
|
2315
2338
|
});
|
|
2316
2339
|
|
|
@@ -2328,7 +2351,7 @@ function processEffectsBlocks(markdown) {
|
|
|
2328
2351
|
}
|
|
2329
2352
|
// Restore code placeholders before the nested parse (tabs-handler
|
|
2330
2353
|
// pattern) so code spans/fences render as <code>, not raw backticks.
|
|
2331
|
-
const innerHtml =
|
|
2354
|
+
const innerHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))));
|
|
2332
2355
|
return `<div class="dm-fx-${name}" data-fx-mode="container"${dataAttrs}>${innerHtml}</div>\n`;
|
|
2333
2356
|
});
|
|
2334
2357
|
}
|
|
@@ -2341,7 +2364,7 @@ function processEffectsBlocks(markdown) {
|
|
|
2341
2364
|
if (attrs.duration) classes.push(`animate-duration-${attrs.duration}`);
|
|
2342
2365
|
if (attrs.delay) classes.push(`animate-delay-${attrs.delay}`);
|
|
2343
2366
|
if (attrs.repeat) classes.push(`animate-${attrs.repeat}`);
|
|
2344
|
-
return `<div class="${classes.join(' ')}">${
|
|
2367
|
+
return `<div class="${classes.join(' ')}">${markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))))}</div>\n`;
|
|
2345
2368
|
});
|
|
2346
2369
|
|
|
2347
2370
|
apply('ambient', (attrStr, body) => {
|
|
@@ -2351,7 +2374,7 @@ function processEffectsBlocks(markdown) {
|
|
|
2351
2374
|
if (attrs.type) classes.push(`bg-ambient-${attrs.type}`);
|
|
2352
2375
|
if (attrs.speed) classes.push(`bg-ambient-${attrs.speed}`);
|
|
2353
2376
|
if (attrs.intensity) classes.push(`bg-ambient-${attrs.intensity}`);
|
|
2354
|
-
return `<div class="${classes.join(' ')}">${
|
|
2377
|
+
return `<div class="${classes.join(' ')}">${markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))))}</div>\n`;
|
|
2355
2378
|
});
|
|
2356
2379
|
|
|
2357
2380
|
return restore(result);
|
|
@@ -2423,7 +2446,7 @@ function processGridBlocks(markdown) {
|
|
|
2423
2446
|
// processCardBlocks, which creates its own empty store and fails to
|
|
2424
2447
|
// decode them, producing the literal string "undefined" in place of
|
|
2425
2448
|
// whatever was in <pre>, ``` fences, or `inline code`.
|
|
2426
|
-
return `<div${cls}${id}${injected.effectDataAttrs}>${
|
|
2449
|
+
return `<div${cls}${id}${injected.effectDataAttrs}>${markedBody(processCardBlocks(processInlineShortcodes(restore(body.trim()))))}</div>`;
|
|
2427
2450
|
}
|
|
2428
2451
|
);
|
|
2429
2452
|
|
|
@@ -2819,7 +2842,7 @@ const LAYOUT_RENDERERS = {};
|
|
|
2819
2842
|
|
|
2820
2843
|
LAYOUT_RENDERERS['basic'] = (attrs, body) => {
|
|
2821
2844
|
const im = cardImageParts(attrs, body, marked);
|
|
2822
|
-
const bodyHtml =
|
|
2845
|
+
const bodyHtml = markedBody(im.body.trim());
|
|
2823
2846
|
return `${cardRoot(attrs)}${im.media}${im.wrapBody(bodyHtml)}${cardFooterAttr(attrs)}</div>\n`;
|
|
2824
2847
|
};
|
|
2825
2848
|
|
|
@@ -2827,7 +2850,7 @@ LAYOUT_RENDERERS['header-body'] = (attrs, body) => {
|
|
|
2827
2850
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2828
2851
|
const hdr = title ? `<div class="card-header"><div class="card-title">${escapeAttr(title)}</div></div>` : '';
|
|
2829
2852
|
const im = cardImageParts(attrs, body, marked);
|
|
2830
|
-
const bodyHtml =
|
|
2853
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(im.body.trim())));
|
|
2831
2854
|
return `${cardRoot(attrs)}${im.media}${hdr}${im.wrapBody(bodyHtml)}${cardFooterAttr(attrs)}</div>\n`;
|
|
2832
2855
|
};
|
|
2833
2856
|
|
|
@@ -2836,7 +2859,7 @@ LAYOUT_RENDERERS['header-body-footer'] = (attrs, body) => {
|
|
|
2836
2859
|
const footer = typeof attrs.footer === 'string' ? attrs.footer.trim() : '';
|
|
2837
2860
|
const hdr = title ? `<div class="card-header"><div class="card-title">${escapeAttr(title)}</div></div>` : '';
|
|
2838
2861
|
const im = cardImageParts(attrs, body, marked);
|
|
2839
|
-
const bodyHtml =
|
|
2862
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(im.body.trim())));
|
|
2840
2863
|
const ftr = footer ? `<div class="card-footer">${escapeAttr(footer)}</div>` : '';
|
|
2841
2864
|
return `${cardRoot(attrs)}${im.media}${hdr}${im.wrapBody(bodyHtml)}${ftr}</div>\n`;
|
|
2842
2865
|
};
|
|
@@ -2844,7 +2867,7 @@ LAYOUT_RENDERERS['header-body-footer'] = (attrs, body) => {
|
|
|
2844
2867
|
LAYOUT_RENDERERS['no-header-footer'] = (attrs, body) => {
|
|
2845
2868
|
const footer = typeof attrs.footer === 'string' ? attrs.footer.trim() : '';
|
|
2846
2869
|
const im = cardImageParts(attrs, body, marked);
|
|
2847
|
-
const bodyHtml =
|
|
2870
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(im.body.trim())));
|
|
2848
2871
|
const ftr = footer ? `<div class="card-footer">${escapeAttr(footer)}</div>` : '';
|
|
2849
2872
|
return `${cardRoot(attrs)}${im.media}${im.wrapBody(bodyHtml)}${ftr}</div>\n`;
|
|
2850
2873
|
};
|
|
@@ -2855,7 +2878,7 @@ LAYOUT_RENDERERS['icon-top'] = (attrs, body) => {
|
|
|
2855
2878
|
const icon = typeof attrs.icon === 'string' ? attrs.icon.trim() : '';
|
|
2856
2879
|
const iconHtml = icon ? `<span data-icon="${escapeAttr(icon)}" class="card-icon"></span>` : '';
|
|
2857
2880
|
const subHtml = subtitle ? `<div class="card-subtitle">${escapeAttr(subtitle)}</div>` : '';
|
|
2858
|
-
const bodyHtml =
|
|
2881
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2859
2882
|
const ih = cardIconHeaderAttrs(attrs);
|
|
2860
2883
|
return `${cardRoot(attrs)}
|
|
2861
2884
|
<div class="card-header card-header-icon-stacked${ih.cls}"${ih.style}>
|
|
@@ -2870,7 +2893,7 @@ LAYOUT_RENDERERS['icon-inline'] = (attrs, body) => {
|
|
|
2870
2893
|
const icon = typeof attrs.icon === 'string' ? attrs.icon.trim() : '';
|
|
2871
2894
|
const iconHtml = icon ? `<span data-icon="${escapeAttr(icon)}"></span>` : '';
|
|
2872
2895
|
const subHtml = subtitle ? `<div class="card-subtitle">${escapeAttr(subtitle)}</div>` : '';
|
|
2873
|
-
const bodyHtml =
|
|
2896
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2874
2897
|
const ih = cardIconHeaderAttrs(attrs);
|
|
2875
2898
|
return `${cardRoot(attrs)}
|
|
2876
2899
|
<div class="card-header card-header-icon-inline${ih.cls}"${ih.style}>
|
|
@@ -2882,13 +2905,13 @@ LAYOUT_RENDERERS['icon-inline'] = (attrs, body) => {
|
|
|
2882
2905
|
LAYOUT_RENDERERS['image-top'] = (attrs, body) => {
|
|
2883
2906
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2884
2907
|
const hdr = title ? `<div class="card-header"><div class="card-title">${escapeAttr(title)}</div></div>` : '';
|
|
2885
|
-
const bodyHtml =
|
|
2908
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2886
2909
|
return `${cardRoot(attrs)}<div class="card-img-top"${imgStyle(attrs)}></div>${hdr}<div class="card-body">${bodyHtml}</div>${cardFooterAttr(attrs)}</div>\n`;
|
|
2887
2910
|
};
|
|
2888
2911
|
|
|
2889
2912
|
LAYOUT_RENDERERS['image-overlay'] = (attrs, body) => {
|
|
2890
2913
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2891
|
-
const bodyHtml =
|
|
2914
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2892
2915
|
return `${cardRoot(attrs)}
|
|
2893
2916
|
<div class="card-img-overlay"${imgStyle(attrs)}>
|
|
2894
2917
|
<div class="card-overlay-text"><div class="card-title">${escapeAttr(title)}</div></div>
|
|
@@ -2898,14 +2921,14 @@ LAYOUT_RENDERERS['image-overlay'] = (attrs, body) => {
|
|
|
2898
2921
|
|
|
2899
2922
|
LAYOUT_RENDERERS['thumb-left'] = (attrs, body) => {
|
|
2900
2923
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2901
|
-
const bodyHtml =
|
|
2924
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2902
2925
|
return `${cardRoot(attrs, ['card-layout-thumb-left'])}<div class="card-img-left"${imgStyle(attrs)}></div>
|
|
2903
2926
|
<div class="card-body">${title ? `<div class="card-title">${escapeAttr(title)}</div>` : ''}${bodyHtml}</div>${cardFooterAttr(attrs)}</div>\n`;
|
|
2904
2927
|
};
|
|
2905
2928
|
|
|
2906
2929
|
LAYOUT_RENDERERS['thumb-right'] = (attrs, body) => {
|
|
2907
2930
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2908
|
-
const bodyHtml =
|
|
2931
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2909
2932
|
return `${cardRoot(attrs, ['card-layout-thumb-right'])}
|
|
2910
2933
|
<div class="card-body">${title ? `<div class="card-title">${escapeAttr(title)}</div>` : ''}${bodyHtml}</div>
|
|
2911
2934
|
<div class="card-img-right"${imgStyle(attrs)}></div></div>\n`;
|
|
@@ -2913,14 +2936,14 @@ LAYOUT_RENDERERS['thumb-right'] = (attrs, body) => {
|
|
|
2913
2936
|
|
|
2914
2937
|
LAYOUT_RENDERERS['wide-left-image'] = (attrs, body) => {
|
|
2915
2938
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2916
|
-
const bodyHtml =
|
|
2939
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2917
2940
|
return `${cardRoot(attrs, ['card-layout-horizontal'])}<div class="card-img-wide"${imgStyle(attrs)}></div>
|
|
2918
2941
|
<div class="card-body">${title ? `<div class="card-title">${escapeAttr(title)}</div>` : ''}${bodyHtml}${cardFooterAttr(attrs)}</div></div>\n`;
|
|
2919
2942
|
};
|
|
2920
2943
|
|
|
2921
2944
|
LAYOUT_RENDERERS['full-bg'] = (attrs, body) => {
|
|
2922
2945
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2923
|
-
const bodyHtml =
|
|
2946
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2924
2947
|
return `${cardRoot(attrs, ['dm-card-full-bg'])}<div class="card-img-top"${imgStyle(attrs)}></div>
|
|
2925
2948
|
<div class="card-body">${title ? `<div class="card-title">${escapeAttr(title)}</div>` : ''}${bodyHtml}</div>${cardFooterAttr(attrs)}</div>\n`;
|
|
2926
2949
|
};
|
|
@@ -2928,7 +2951,7 @@ LAYOUT_RENDERERS['full-bg'] = (attrs, body) => {
|
|
|
2928
2951
|
LAYOUT_RENDERERS['split-half'] = (attrs, body) => {
|
|
2929
2952
|
const title = typeof attrs.title === 'string' ? attrs.title.trim() : '';
|
|
2930
2953
|
const gradient = typeof attrs.gradient === 'string' ? attrs.gradient.trim() : 'indigo';
|
|
2931
|
-
const bodyHtml =
|
|
2954
|
+
const bodyHtml = markedBody(processGridBlocks(processInlineShortcodes(body.trim())));
|
|
2932
2955
|
return `${cardRoot(attrs, ['card-layout-split'])}<div class="card-split-left card-gradient-${escapeAttr(gradient)}"${imgStyle(attrs)}></div>
|
|
2933
2956
|
<div class="card-split-right"><div class="card-body">${title ? `<div class="card-title">${escapeAttr(title)}</div>` : ''}${bodyHtml}</div></div></div>\n`;
|
|
2934
2957
|
};
|
|
@@ -2944,7 +2967,7 @@ LAYOUT_RENDERERS['avatar-profile'] = (attrs, body) => {
|
|
|
2944
2967
|
const tags = typeof attrs.tags === 'string' ? attrs.tags.split(',').map(t => t.trim()).filter(Boolean) : [];
|
|
2945
2968
|
const tagHtml = tags.length ? `<div class="card-tag-pills">${tags.map(t => `<span class="card-pill">${escapeAttr(t)}</span>`).join('')}</div>` : '';
|
|
2946
2969
|
const iconHtml = icon ? `<span data-icon="${icon}"></span>` : '';
|
|
2947
|
-
const bodyHtml = body.trim() ? `<div class="card-body">${
|
|
2970
|
+
const bodyHtml = body.trim() ? `<div class="card-body">${markedBody(body.trim())}</div>` : '';
|
|
2948
2971
|
return `${cardRoot(attrs)}<div class="card-avatar-wrap">
|
|
2949
2972
|
<div class="card-avatar">${iconHtml}</div>
|
|
2950
2973
|
${title ? `<div class="card-title">${title}</div>` : ''}
|
|
@@ -2969,7 +2992,7 @@ LAYOUT_RENDERERS['stat-metric'] = (attrs, _body) => {
|
|
|
2969
2992
|
LAYOUT_RENDERERS['quote-testimonial'] = (attrs, body) => {
|
|
2970
2993
|
const author = escapeAttr(attrs.title || '');
|
|
2971
2994
|
const role = escapeAttr(attrs.subtitle || '');
|
|
2972
|
-
const bodyHtml = body.trim() ?
|
|
2995
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
2973
2996
|
return `${cardRoot(attrs)}<span class="card-quote-mark">\u201c</span>
|
|
2974
2997
|
<div class="card-quote-text">${bodyHtml}</div>
|
|
2975
2998
|
<div class="card-footer card-quote-attr">
|
|
@@ -2983,7 +3006,7 @@ LAYOUT_RENDERERS['callout'] = (attrs, body) => {
|
|
|
2983
3006
|
const defaults = {info: '💡', warn: '⚠️', success: '✅', error: '❌'};
|
|
2984
3007
|
const icon = escapeAttr(attrs.icon || defaults[type] || '💡');
|
|
2985
3008
|
const title = escapeAttr(attrs.title || '');
|
|
2986
|
-
const bodyHtml =
|
|
3009
|
+
const bodyHtml = markedBody(body.trim());
|
|
2987
3010
|
return `${cardRoot(attrs, ['card-callout', type])}<div class="card-callout-inner card-body">
|
|
2988
3011
|
<div class="card-callout-icon"><span data-icon="${icon}"></span></div>
|
|
2989
3012
|
<div>${title ? `<div class="card-title">${title}</div>` : ''}${bodyHtml}</div>
|
|
@@ -2993,7 +3016,7 @@ LAYOUT_RENDERERS['callout'] = (attrs, body) => {
|
|
|
2993
3016
|
LAYOUT_RENDERERS['video-media'] = (attrs, body) => {
|
|
2994
3017
|
const title = escapeAttr(attrs.title || '');
|
|
2995
3018
|
const duration = escapeAttr(attrs.duration || '');
|
|
2996
|
-
const bodyHtml = body.trim() ?
|
|
3019
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
2997
3020
|
const dur = duration ? `<div class="card-video-duration">${duration}</div>` : '';
|
|
2998
3021
|
return `${cardRoot(attrs)}<div class="card-video-thumb"${imgStyle(attrs)}>
|
|
2999
3022
|
<div class="card-play-btn">\u25B6</div>${dur}
|
|
@@ -3004,7 +3027,7 @@ LAYOUT_RENDERERS['video-media'] = (attrs, body) => {
|
|
|
3004
3027
|
LAYOUT_RENDERERS['location-map'] = (attrs, body) => {
|
|
3005
3028
|
const address = escapeAttr(attrs.address || '');
|
|
3006
3029
|
const title = escapeAttr(attrs.title || '');
|
|
3007
|
-
const bodyHtml = body.trim() ?
|
|
3030
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3008
3031
|
return `${cardRoot(attrs)}<div class="card-map-placeholder">
|
|
3009
3032
|
<div class="card-map-grid"></div><div class="card-map-pin">📍</div>
|
|
3010
3033
|
</div>${title || address ? `<div class="card-body">${title ? `<div class="card-title">${title}</div>` : ''}${address ? `<div class="card-subtitle">${address}</div>` : ''}${bodyHtml}</div>` : ''}</div>\n`;
|
|
@@ -3014,7 +3037,7 @@ LAYOUT_RENDERERS['step-numbered'] = (attrs, body) => {
|
|
|
3014
3037
|
const step = escapeAttr(String(attrs.step || '1'));
|
|
3015
3038
|
const title = escapeAttr(attrs.title || '');
|
|
3016
3039
|
const gradient = escapeAttr(attrs.gradient || 'indigo');
|
|
3017
|
-
const bodyHtml = body.trim() ?
|
|
3040
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3018
3041
|
return `${cardRoot(attrs)}<div class="card-step-bg card-gradient-${gradient}">
|
|
3019
3042
|
<div class="card-step-badge">${step}</div>
|
|
3020
3043
|
<div class="card-step-ghost">${step}</div>
|
|
@@ -3026,7 +3049,7 @@ LAYOUT_RENDERERS['corner-badge'] = (attrs, body) => {
|
|
|
3026
3049
|
const badge = escapeAttr(attrs.badge || 'New');
|
|
3027
3050
|
const title = escapeAttr(attrs.title || '');
|
|
3028
3051
|
const icon = escapeAttr(attrs.icon || '');
|
|
3029
|
-
const bodyHtml = body.trim() ?
|
|
3052
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3030
3053
|
return `${cardRoot(attrs, ['card-corner-badge-wrap'])}<span class="card-corner-badge">${badge}</span>
|
|
3031
3054
|
${icon ? `<div style="display:flex;justify-content:center;padding:18px 16px 4px"><span data-icon="${icon}" style="font-size:2rem"></span></div>` : ''}
|
|
3032
3055
|
<div class="card-body" style="text-align:center">${title ? `<div class="card-title">${title}</div>` : ''}${bodyHtml}</div>${cardFooterAttr(attrs)}</div>\n`;
|
|
@@ -3037,7 +3060,7 @@ LAYOUT_RENDERERS['badge-band'] = (attrs, body) => {
|
|
|
3037
3060
|
const icon = escapeAttr(attrs.icon || '');
|
|
3038
3061
|
const gradient = escapeAttr(attrs.gradient || 'indigo');
|
|
3039
3062
|
const title = escapeAttr(attrs.title || '');
|
|
3040
|
-
const bodyHtml = body.trim() ?
|
|
3063
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3041
3064
|
return `${cardRoot(attrs)}<div class="card-badge-band card-gradient-${gradient}">
|
|
3042
3065
|
<span class="card-badge-band-label">${badge}</span>
|
|
3043
3066
|
${icon ? `<span class="card-badge-band-icon" data-icon="${icon}"></span>` : ''}
|
|
@@ -3047,7 +3070,7 @@ LAYOUT_RENDERERS['badge-band'] = (attrs, body) => {
|
|
|
3047
3070
|
|
|
3048
3071
|
LAYOUT_RENDERERS['glass-gradient-border'] = (attrs, body) => {
|
|
3049
3072
|
const title = escapeAttr(attrs.title || '');
|
|
3050
|
-
const bodyHtml =
|
|
3073
|
+
const bodyHtml = markedBody(body.trim());
|
|
3051
3074
|
return `<div class="card-glass-outer mb-4">
|
|
3052
3075
|
<div class="card-glass-inner">
|
|
3053
3076
|
${title ? `<div class="card-title">${title}</div>` : ''}<div>${bodyHtml}</div>
|
|
@@ -3060,7 +3083,7 @@ LAYOUT_RENDERERS['rating-review'] = (attrs, body) => {
|
|
|
3060
3083
|
const author = escapeAttr(attrs.title || '');
|
|
3061
3084
|
const role = escapeAttr(attrs.subtitle || '');
|
|
3062
3085
|
const verified = 'verified' in attrs;
|
|
3063
|
-
const bodyHtml = body.trim() ?
|
|
3086
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3064
3087
|
return `${cardRoot(attrs)}<span class="card-stars">${stars}</span>
|
|
3065
3088
|
<div class="card-quote-text">${bodyHtml}</div>
|
|
3066
3089
|
<div class="card-footer card-quote-attr">
|
|
@@ -3074,7 +3097,7 @@ LAYOUT_RENDERERS['tag-cloud'] = (attrs, body) => {
|
|
|
3074
3097
|
const title = escapeAttr(attrs.title || '');
|
|
3075
3098
|
const tagAttr = typeof attrs.tags === 'string' ? attrs.tags.split(',').map(t => t.trim()).filter(Boolean) : [];
|
|
3076
3099
|
const tagHtml = tagAttr.map((t, i) => `<span class="card-tag" style="${tagColorStyle(i)}">${escapeAttr(t)}</span>`).join('');
|
|
3077
|
-
const bodyHtml = body.trim() ?
|
|
3100
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3078
3101
|
return `${cardRoot(attrs)}${title ? `<div class="card-header"><div class="card-title">${title}</div></div>` : ''}
|
|
3079
3102
|
<div class="card-tag-cloud">${tagHtml}${bodyHtml}</div></div>\n`;
|
|
3080
3103
|
};
|
|
@@ -3083,7 +3106,7 @@ LAYOUT_RENDERERS['timeline-entry'] = (attrs, body) => {
|
|
|
3083
3106
|
const date = escapeAttr(attrs.subtitle || '');
|
|
3084
3107
|
const title = escapeAttr(attrs.title || '');
|
|
3085
3108
|
const tag = escapeAttr(attrs.badge || '');
|
|
3086
|
-
const bodyHtml = body.trim() ?
|
|
3109
|
+
const bodyHtml = body.trim() ? markedBody(body.trim()) : '';
|
|
3087
3110
|
return `${cardRoot(attrs)}<div class="card-timeline-row">
|
|
3088
3111
|
<div class="card-timeline-side"><div class="card-timeline-dot"></div><div class="card-timeline-line"></div></div>
|
|
3089
3112
|
<div class="card-timeline-body">
|
|
@@ -3509,7 +3532,7 @@ function processTabsBlocks(markdown) {
|
|
|
3509
3532
|
// so fenced code blocks render as <pre><code> rather than surviving as raw text
|
|
3510
3533
|
// that would confuse subsequent scrubCodeRegions calls.
|
|
3511
3534
|
const restoredBody = restore(tabBody.trim());
|
|
3512
|
-
const bodyHtml =
|
|
3535
|
+
const bodyHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restoredBody))));
|
|
3513
3536
|
const icon = tabAttrs.icon ? tabAttrs.icon.trim() : '';
|
|
3514
3537
|
items.push({title, icon, paneId, bodyHtml, first: tabIdx === 1});
|
|
3515
3538
|
});
|
|
@@ -3564,7 +3587,7 @@ function processAccordionBlocks(markdown) {
|
|
|
3564
3587
|
body.replace(/\[item([^\]]*)\]([\s\S]*?)\[\/item\]/gi, (__, itemAttr, itemBody) => {
|
|
3565
3588
|
const itemAttrs = parseShortcodeAttrs(itemAttr);
|
|
3566
3589
|
const title = itemAttrs.title || 'Item';
|
|
3567
|
-
const bodyHtml =
|
|
3590
|
+
const bodyHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(itemBody.trim())))));
|
|
3568
3591
|
items += (
|
|
3569
3592
|
`<div class="accordion-item">\n` +
|
|
3570
3593
|
` <h3 class="accordion-header"><button class="accordion-button" type="button">${escapeAttr(title)}` +
|
|
@@ -3637,7 +3660,7 @@ function processCarouselBlocks(markdown) {
|
|
|
3637
3660
|
if (slideAttrs.image) {
|
|
3638
3661
|
inner += `<img src="${escapeAttr(slideAttrs.image)}" alt="${escapeAttr(slideAttrs.title || '')}">\n`;
|
|
3639
3662
|
}
|
|
3640
|
-
const contentHtml =
|
|
3663
|
+
const contentHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(slideBody.trim())))));
|
|
3641
3664
|
if (slideAttrs.title || slideBody.trim()) {
|
|
3642
3665
|
inner += `<div class="carousel-slide-content">`;
|
|
3643
3666
|
if (slideAttrs.title) inner += `<h2 class="carousel-slide-title">${escapeAttr(slideAttrs.title)}</h2>`;
|
|
@@ -3740,7 +3763,7 @@ function processTimelineBlocks(markdown) {
|
|
|
3740
3763
|
const status = ia.status ? ` data-status="${escapeAttr(ia.status)}"` : '';
|
|
3741
3764
|
// data-event-icon, never data-icon - see renderCollectionTimeline: the icon scanner would empty the item.
|
|
3742
3765
|
const icon = ia.icon ? ` data-event-icon="${escapeAttr(ia.icon)}"` : '';
|
|
3743
|
-
const descHtml =
|
|
3766
|
+
const descHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(itemBody.trim())))));
|
|
3744
3767
|
return `<div class="dm-progression-item"${date}${status}${icon}><div class="dm-progression-item-title">${title}</div><div class="dm-progression-item-body">${descHtml}</div></div>`;
|
|
3745
3768
|
}
|
|
3746
3769
|
);
|
|
@@ -4960,7 +4983,7 @@ function processHeroBlocks(markdown) {
|
|
|
4960
4983
|
inner += '<div class="hero-content">';
|
|
4961
4984
|
if (title) inner += `<h1 class="hero-title hero-title-responsive">${escapeAttr(title)}</h1>`;
|
|
4962
4985
|
if (tagline) inner += `<p class="hero-subtitle hero-subtitle-responsive">${escapeAttr(tagline)}</p>`;
|
|
4963
|
-
if (processedBody) inner += `<div class="hero-body">${
|
|
4986
|
+
if (processedBody) inner += `<div class="hero-body">${markedBody(processedBody)}</div>`;
|
|
4964
4987
|
inner += '</div>';
|
|
4965
4988
|
|
|
4966
4989
|
return `<div class="${classes.join(' ')}"${idAttr}${style}${injected.effectDataAttrs}>${inner}</div>\n`;
|
|
@@ -5026,7 +5049,7 @@ function processBannerBlocks(markdown) {
|
|
|
5026
5049
|
const titleHtml = title
|
|
5027
5050
|
? `<strong class="dm-banner__title">${escapeAttr(title)}</strong>\n `
|
|
5028
5051
|
: '';
|
|
5029
|
-
const bodyHtml =
|
|
5052
|
+
const bodyHtml = markedBody(body.trim());
|
|
5030
5053
|
const dismissHtml = dismissible
|
|
5031
5054
|
? `\n <button type="button" class="dm-banner__dismiss" aria-label="Dismiss">×</button>`
|
|
5032
5055
|
: '';
|
|
@@ -5055,7 +5078,7 @@ function processSlideoverBlocks(markdown) {
|
|
|
5055
5078
|
const trigger = escapeAttr(attrs.trigger || 'Open');
|
|
5056
5079
|
const size = escapeAttr(attrs.size || 'md');
|
|
5057
5080
|
const position = escapeAttr(attrs.position || 'right');
|
|
5058
|
-
const bodyHtml =
|
|
5081
|
+
const bodyHtml = markedBody(processCardBlocks(processGridBlocks(processInlineShortcodes(restore(body.trim())))));
|
|
5059
5082
|
return (
|
|
5060
5083
|
`<button class="btn btn-link dm-so-trigger" data-so-target="${id}">${trigger}</button>\n` +
|
|
5061
5084
|
`<div class="dm-so-content" id="${id}" style="display:none" ` +
|