jsonresume-theme-reference 0.2.13 → 0.2.14
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 +8 -0
- package/dist/index.js +47 -46
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# jsonresume-theme-reference
|
|
2
2
|
|
|
3
|
+
## 0.2.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 601e883: `ListItem` renders inline Markdown in string `description` and `highlights` with the shared renderer (#600); React nodes pass through unchanged.
|
|
8
|
+
- Updated dependencies [601e883]
|
|
9
|
+
- @jsonresume/core@0.4.1
|
|
10
|
+
|
|
3
11
|
## 0.2.13
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1386,6 +1386,50 @@ function SectionTitle({
|
|
|
1386
1386
|
}
|
|
1387
1387
|
);
|
|
1388
1388
|
}
|
|
1389
|
+
const ESCAPES = {
|
|
1390
|
+
"&": "&",
|
|
1391
|
+
"<": "<",
|
|
1392
|
+
">": ">",
|
|
1393
|
+
'"': """,
|
|
1394
|
+
"'": "'"
|
|
1395
|
+
};
|
|
1396
|
+
const escapeHtml = (text) => text.replace(/[&<>"']/g, (c) => ESCAPES[c]);
|
|
1397
|
+
const ESCAPABLE = /\\([\\`*_[\]()!#])/g;
|
|
1398
|
+
const CODE = /`([^`]+)`/g;
|
|
1399
|
+
const LINK = /\[([^\]]+)\]\(([^)\s]+)\)/g;
|
|
1400
|
+
const STRONG = /\*\*(?=\S)([^*]*?\S)\*\*|__(?=\S)([^_]*?\S)__/g;
|
|
1401
|
+
const EMPHASIS = /\*(?=\S)([^*]*?\S)\*|(^|[^\p{L}\p{N}_])_(?=\S)([^_]*?\S)_(?![\p{L}\p{N}_])/gu;
|
|
1402
|
+
const safeHref = (url) => /^(https?:\/\/|mailto:)/i.test(url) ? url : void 0;
|
|
1403
|
+
const emphasis = (text, strong, em) => text.replace(STRONG, (_2, a, b2) => strong(a ?? b2)).replace(
|
|
1404
|
+
EMPHASIS,
|
|
1405
|
+
(_2, a, before, b2) => a !== void 0 ? em(a) : `${before}${em(b2)}`
|
|
1406
|
+
);
|
|
1407
|
+
const inline = (text, out) => {
|
|
1408
|
+
const kept = [];
|
|
1409
|
+
const keep = (value) => `${kept.push(value) - 1}`;
|
|
1410
|
+
const marks = (t) => emphasis(t, out.strong, out.em);
|
|
1411
|
+
const rest = text.replace(/\uE000/g, "").replace(ESCAPABLE, (_2, c) => keep(out.text(c))).replace(CODE, (_2, body) => keep(out.code(body))).replace(
|
|
1412
|
+
LINK,
|
|
1413
|
+
(_2, label, url) => keep(out.link(marks(out.text(label)), url))
|
|
1414
|
+
);
|
|
1415
|
+
return marks(out.text(rest)).replace(
|
|
1416
|
+
/\uE000(\d+)\uE000/g,
|
|
1417
|
+
(_2, i) => kept[Number(i)]
|
|
1418
|
+
);
|
|
1419
|
+
};
|
|
1420
|
+
function renderInlineMarkdown(text) {
|
|
1421
|
+
if (typeof text !== "string") return "";
|
|
1422
|
+
return inline(text, {
|
|
1423
|
+
text: escapeHtml,
|
|
1424
|
+
code: (body) => `<code>${escapeHtml(body)}</code>`,
|
|
1425
|
+
link: (label, url) => {
|
|
1426
|
+
const href = safeHref(url);
|
|
1427
|
+
return href ? `<a href="${escapeHtml(href)}">${label}</a>` : label;
|
|
1428
|
+
},
|
|
1429
|
+
strong: (t) => `<strong>${t}</strong>`,
|
|
1430
|
+
em: (t) => `<em>${t}</em>`
|
|
1431
|
+
});
|
|
1432
|
+
}
|
|
1389
1433
|
const ItemContainer = dt.div`
|
|
1390
1434
|
margin-bottom: ${(props) => props.theme?.spacing?.item || "var(--resume-space-item, 1rem)"};
|
|
1391
1435
|
|
|
@@ -1429,6 +1473,7 @@ const Highlights = dt.ul`
|
|
|
1429
1473
|
line-height: 1.5;
|
|
1430
1474
|
}
|
|
1431
1475
|
`;
|
|
1476
|
+
const prose$1 = (value) => typeof value === "string" ? { dangerouslySetInnerHTML: { __html: renderInlineMarkdown(value) } } : { children: value };
|
|
1432
1477
|
function ListItem({
|
|
1433
1478
|
title,
|
|
1434
1479
|
subtitle,
|
|
@@ -1454,8 +1499,8 @@ function ListItem({
|
|
|
1454
1499
|
dateRange && location && /* @__PURE__ */ jsx("span", { children: "•" }),
|
|
1455
1500
|
location && /* @__PURE__ */ jsx("span", { className: "resume-location", children: location })
|
|
1456
1501
|
] }),
|
|
1457
|
-
description && /* @__PURE__ */ jsx(Description, { className: "resume-description",
|
|
1458
|
-
highlights.length > 0 && /* @__PURE__ */ jsx(Highlights, { className: "resume-highlights", children: highlights.map((highlight, index2) => /* @__PURE__ */ jsx("li", {
|
|
1502
|
+
description && /* @__PURE__ */ jsx(Description, { className: "resume-description", ...prose$1(description) }),
|
|
1503
|
+
highlights.length > 0 && /* @__PURE__ */ jsx(Highlights, { className: "resume-highlights", children: highlights.map((highlight, index2) => /* @__PURE__ */ jsx("li", { ...prose$1(highlight) }, index2)) })
|
|
1459
1504
|
]
|
|
1460
1505
|
}
|
|
1461
1506
|
);
|
|
@@ -1732,50 +1777,6 @@ dt.span`
|
|
|
1732
1777
|
}
|
|
1733
1778
|
}
|
|
1734
1779
|
`;
|
|
1735
|
-
const ESCAPES = {
|
|
1736
|
-
"&": "&",
|
|
1737
|
-
"<": "<",
|
|
1738
|
-
">": ">",
|
|
1739
|
-
'"': """,
|
|
1740
|
-
"'": "'"
|
|
1741
|
-
};
|
|
1742
|
-
const escapeHtml = (text) => text.replace(/[&<>"']/g, (c) => ESCAPES[c]);
|
|
1743
|
-
const ESCAPABLE = /\\([\\`*_[\]()!#])/g;
|
|
1744
|
-
const CODE = /`([^`]+)`/g;
|
|
1745
|
-
const LINK = /\[([^\]]+)\]\(([^)\s]+)\)/g;
|
|
1746
|
-
const STRONG = /\*\*(?=\S)([^*]*?\S)\*\*|__(?=\S)([^_]*?\S)__/g;
|
|
1747
|
-
const EMPHASIS = /\*(?=\S)([^*]*?\S)\*|(^|[^\p{L}\p{N}_])_(?=\S)([^_]*?\S)_(?![\p{L}\p{N}_])/gu;
|
|
1748
|
-
const safeHref = (url) => /^(https?:\/\/|mailto:)/i.test(url) ? url : void 0;
|
|
1749
|
-
const emphasis = (text, strong, em) => text.replace(STRONG, (_2, a, b2) => strong(a ?? b2)).replace(
|
|
1750
|
-
EMPHASIS,
|
|
1751
|
-
(_2, a, before, b2) => a !== void 0 ? em(a) : `${before}${em(b2)}`
|
|
1752
|
-
);
|
|
1753
|
-
const inline = (text, out) => {
|
|
1754
|
-
const kept = [];
|
|
1755
|
-
const keep = (value) => `${kept.push(value) - 1}`;
|
|
1756
|
-
const marks = (t) => emphasis(t, out.strong, out.em);
|
|
1757
|
-
const rest = text.replace(/\uE000/g, "").replace(ESCAPABLE, (_2, c) => keep(out.text(c))).replace(CODE, (_2, body) => keep(out.code(body))).replace(
|
|
1758
|
-
LINK,
|
|
1759
|
-
(_2, label, url) => keep(out.link(marks(out.text(label)), url))
|
|
1760
|
-
);
|
|
1761
|
-
return marks(out.text(rest)).replace(
|
|
1762
|
-
/\uE000(\d+)\uE000/g,
|
|
1763
|
-
(_2, i) => kept[Number(i)]
|
|
1764
|
-
);
|
|
1765
|
-
};
|
|
1766
|
-
function renderInlineMarkdown(text) {
|
|
1767
|
-
if (typeof text !== "string") return "";
|
|
1768
|
-
return inline(text, {
|
|
1769
|
-
text: escapeHtml,
|
|
1770
|
-
code: (body) => `<code>${escapeHtml(body)}</code>`,
|
|
1771
|
-
link: (label, url) => {
|
|
1772
|
-
const href = safeHref(url);
|
|
1773
|
-
return href ? `<a href="${escapeHtml(href)}">${label}</a>` : label;
|
|
1774
|
-
},
|
|
1775
|
-
strong: (t) => `<strong>${t}</strong>`,
|
|
1776
|
-
em: (t) => `<em>${t}</em>`
|
|
1777
|
-
});
|
|
1778
|
-
}
|
|
1779
1780
|
function InlineMarkdown({ text, as: Tag = "span", ...rest }) {
|
|
1780
1781
|
return /* @__PURE__ */ jsx(
|
|
1781
1782
|
Tag,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsonresume-theme-reference",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"description": "Reference theme demonstrating @resume/core best practices - ATS-friendly, framework-agnostic",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"react": "^19.2.0",
|
|
27
27
|
"react-dom": "^19.2.0",
|
|
28
28
|
"styled-components": "^6.1.19",
|
|
29
|
-
"@jsonresume/core": "0.4.
|
|
29
|
+
"@jsonresume/core": "0.4.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"vitest": "^3.2.6",
|