anentrypoint-design 0.0.338 → 0.0.339
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/247420.js +1 -1
- package/package.json +1 -1
- package/src/page-html.js +16 -2
package/dist/247420.js
CHANGED
|
@@ -152,7 +152,7 @@ var Lc=Object.defineProperty;var ie=(e,t)=>()=>(e&&(t=e(e=0)),t);var ct=(e,t)=>{
|
|
|
152
152
|
.ds-247420[data-motion="reduced"] [data-anim="ready"] {
|
|
153
153
|
transition: none !important;
|
|
154
154
|
}`.trim(),document.head.appendChild(e)}function kn(e){if(!e||typeof e.querySelectorAll!="function")return;e.querySelectorAll(".ds-hero,.panel,.ds-section,.app-main > *").forEach((n,s)=>{if(n.dataset.anim==="ready")return;n.dataset.anim="in";let a=Math.min(s,6)*30;setTimeout(()=>{n.dataset.anim="ready"},a)})}Ye();It();Ta();Qn();It();var be=tt;function ic(e){return e.replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>')}function Pr(e){return String(e||"").trim().toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-")}function Ou(e){let t=String(e||"").split(`
|
|
155
|
-
`),n=[],s=!1,a=!1;for(let
|
|
155
|
+
`),n=[],s=!1,a=!1,r=!1;for(let o of t){if(o.trim()==="```html"&&!s){r=!0;continue}if(o.startsWith("```")){if(r){r=!1;continue}s?(n.push("</pre>"),s=!1):(n.push("<pre>"),s=!0);continue}if(r){n.push(o);continue}if(s){n.push(be(o));continue}if(o.startsWith("# ")){let l=o.slice(2);n.push(`<h1 id="${Pr(l)}">${be(l)}</h1>`)}else if(o.startsWith("## ")){let l=o.slice(3);n.push(`<h2 id="${Pr(l)}">${be(l)}</h2>`)}else if(o.startsWith("### ")){let l=o.slice(4);n.push(`<h3 id="${Pr(l)}">${be(l)}</h3>`)}else o.startsWith("- ")?(a||(n.push("<ul>"),a=!0),n.push(`<li>${ic(be(o.slice(2)))}</li>`)):(a&&(n.push("</ul>"),a=!1),o.trim()&&n.push(`<p>${ic(be(o))}</p>`))}return a&&n.push("</ul>"),s&&n.push("</pre>"),n.join(`
|
|
156
156
|
`)}function Nu(e,t){if(!t)return"#";let n=String(t);if(/^([a-z]+:|#|\/\/)/i.test(n)||!e)return n;let s=e.replace(/\/+$/,"");return n.startsWith("/")?s+n:s+"/"+n.replace(/^\.?\//,"")}function qu({title:e,siteName:t,seo:n}){let s=be(n.description||""),a=be(n.lang||"en"),r=be(n.url||""),o=be(n.image||""),l=be(n.author||t),i=be(n.twitter||""),c=be(n.locale||"en_US"),d=be(Array.isArray(n.keywords)?n.keywords.join(", "):n.keywords||""),u=be(e),p=be(n.description||t),f=`
|
|
157
157
|
<meta name="description" content="${s}">
|
|
158
158
|
${d?`<meta name="keywords" content="${d}">`:""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.339",
|
|
4
4
|
"description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/247420.js",
|
package/src/page-html.js
CHANGED
|
@@ -37,12 +37,26 @@ export function slugify(s) {
|
|
|
37
37
|
.replace(/\s+/g, '-');
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
// Raw-HTML passthrough block, opt-in via ```html fences. Distinct from a
|
|
41
|
+
// plain ``` code fence (which still escapes+<pre>-wraps its contents) — this
|
|
42
|
+
// is for SSR call sites that are trusted, repo-authored content (a theme.mjs
|
|
43
|
+
// page body sourced from the project's own YAML, never end-user input) and
|
|
44
|
+
// need to emit real markup (e.g. an <iframe> demo embed) that must NOT be
|
|
45
|
+
// escaped. There is no sanitization here by design: the caller owns trust.
|
|
46
|
+
// A consumer rendering untrusted content must not route it through this
|
|
47
|
+
// path — use markdown.js's DOMPurify-backed renderMarkdown for that instead.
|
|
40
48
|
export function renderMarkdown(md) {
|
|
41
49
|
const lines = String(md || '').split('\n');
|
|
42
50
|
const out = [];
|
|
43
|
-
let inCode = false, inList = false;
|
|
51
|
+
let inCode = false, inList = false, inRawHtml = false;
|
|
44
52
|
for (const line of lines) {
|
|
45
|
-
if (line.
|
|
53
|
+
if (line.trim() === '```html') { if (!inCode) { inRawHtml = true; continue; } }
|
|
54
|
+
if (line.startsWith('```')) {
|
|
55
|
+
if (inRawHtml) { inRawHtml = false; continue; }
|
|
56
|
+
if (inCode) { out.push('</pre>'); inCode = false; } else { out.push('<pre>'); inCode = true; }
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (inRawHtml) { out.push(line); continue; }
|
|
46
60
|
if (inCode) { out.push(escape(line)); continue; }
|
|
47
61
|
if (line.startsWith('# ')) { const t = line.slice(2); out.push(`<h1 id="${slugify(t)}">${escape(t)}</h1>`); }
|
|
48
62
|
else if (line.startsWith('## ')) { const t = line.slice(3); out.push(`<h2 id="${slugify(t)}">${escape(t)}</h2>`); }
|