jsonresume-theme-sidebar 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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # jsonresume-theme-sidebar
2
2
 
3
+ ## 0.2.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [601e883]
8
+ - @jsonresume/core@0.4.1
9
+
3
10
  ## 0.2.13
4
11
 
5
12
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1435,6 +1435,50 @@ dt.span`
1435
1435
  margin-right: 8px;
1436
1436
  font-size: 1.2em;
1437
1437
  `;
1438
+ const ESCAPES = {
1439
+ "&": "&",
1440
+ "<": "&lt;",
1441
+ ">": "&gt;",
1442
+ '"': "&quot;",
1443
+ "'": "&#39;"
1444
+ };
1445
+ const escapeHtml = (text) => text.replace(/[&<>"']/g, (c) => ESCAPES[c]);
1446
+ const ESCAPABLE = /\\([\\`*_[\]()!#])/g;
1447
+ const CODE = /`([^`]+)`/g;
1448
+ const LINK = /\[([^\]]+)\]\(([^)\s]+)\)/g;
1449
+ const STRONG = /\*\*(?=\S)([^*]*?\S)\*\*|__(?=\S)([^_]*?\S)__/g;
1450
+ const EMPHASIS = /\*(?=\S)([^*]*?\S)\*|(^|[^\p{L}\p{N}_])_(?=\S)([^_]*?\S)_(?![\p{L}\p{N}_])/gu;
1451
+ const safeHref = (url) => /^(https?:\/\/|mailto:)/i.test(url) ? url : void 0;
1452
+ const emphasis = (text, strong, em) => text.replace(STRONG, (_2, a, b2) => strong(a ?? b2)).replace(
1453
+ EMPHASIS,
1454
+ (_2, a, before, b2) => a !== void 0 ? em(a) : `${before}${em(b2)}`
1455
+ );
1456
+ const inline = (text, out) => {
1457
+ const kept = [];
1458
+ const keep = (value) => `${kept.push(value) - 1}`;
1459
+ const marks = (t) => emphasis(t, out.strong, out.em);
1460
+ const rest = text.replace(/\uE000/g, "").replace(ESCAPABLE, (_2, c) => keep(out.text(c))).replace(CODE, (_2, body) => keep(out.code(body))).replace(
1461
+ LINK,
1462
+ (_2, label, url) => keep(out.link(marks(out.text(label)), url))
1463
+ );
1464
+ return marks(out.text(rest)).replace(
1465
+ /\uE000(\d+)\uE000/g,
1466
+ (_2, i) => kept[Number(i)]
1467
+ );
1468
+ };
1469
+ function renderInlineMarkdown(text) {
1470
+ if (typeof text !== "string") return "";
1471
+ return inline(text, {
1472
+ text: escapeHtml,
1473
+ code: (body) => `<code>${escapeHtml(body)}</code>`,
1474
+ link: (label, url) => {
1475
+ const href = safeHref(url);
1476
+ return href ? `<a href="${escapeHtml(href)}">${label}</a>` : label;
1477
+ },
1478
+ strong: (t) => `<strong>${t}</strong>`,
1479
+ em: (t) => `<em>${t}</em>`
1480
+ });
1481
+ }
1438
1482
  dt.div`
1439
1483
  margin-bottom: ${(props) => props.theme?.spacing?.item || "var(--resume-space-item, 1rem)"};
1440
1484
 
@@ -1655,50 +1699,6 @@ dt.span`
1655
1699
  }
1656
1700
  }
1657
1701
  `;
1658
- const ESCAPES = {
1659
- "&": "&amp;",
1660
- "<": "&lt;",
1661
- ">": "&gt;",
1662
- '"': "&quot;",
1663
- "'": "&#39;"
1664
- };
1665
- const escapeHtml = (text) => text.replace(/[&<>"']/g, (c) => ESCAPES[c]);
1666
- const ESCAPABLE = /\\([\\`*_[\]()!#])/g;
1667
- const CODE = /`([^`]+)`/g;
1668
- const LINK = /\[([^\]]+)\]\(([^)\s]+)\)/g;
1669
- const STRONG = /\*\*(?=\S)([^*]*?\S)\*\*|__(?=\S)([^_]*?\S)__/g;
1670
- const EMPHASIS = /\*(?=\S)([^*]*?\S)\*|(^|[^\p{L}\p{N}_])_(?=\S)([^_]*?\S)_(?![\p{L}\p{N}_])/gu;
1671
- const safeHref = (url) => /^(https?:\/\/|mailto:)/i.test(url) ? url : void 0;
1672
- const emphasis = (text, strong, em) => text.replace(STRONG, (_2, a, b2) => strong(a ?? b2)).replace(
1673
- EMPHASIS,
1674
- (_2, a, before, b2) => a !== void 0 ? em(a) : `${before}${em(b2)}`
1675
- );
1676
- const inline = (text, out) => {
1677
- const kept = [];
1678
- const keep = (value) => `${kept.push(value) - 1}`;
1679
- const marks = (t) => emphasis(t, out.strong, out.em);
1680
- const rest = text.replace(/\uE000/g, "").replace(ESCAPABLE, (_2, c) => keep(out.text(c))).replace(CODE, (_2, body) => keep(out.code(body))).replace(
1681
- LINK,
1682
- (_2, label, url) => keep(out.link(marks(out.text(label)), url))
1683
- );
1684
- return marks(out.text(rest)).replace(
1685
- /\uE000(\d+)\uE000/g,
1686
- (_2, i) => kept[Number(i)]
1687
- );
1688
- };
1689
- function renderInlineMarkdown(text) {
1690
- if (typeof text !== "string") return "";
1691
- return inline(text, {
1692
- text: escapeHtml,
1693
- code: (body) => `<code>${escapeHtml(body)}</code>`,
1694
- link: (label, url) => {
1695
- const href = safeHref(url);
1696
- return href ? `<a href="${escapeHtml(href)}">${label}</a>` : label;
1697
- },
1698
- strong: (t) => `<strong>${t}</strong>`,
1699
- em: (t) => `<em>${t}</em>`
1700
- });
1701
- }
1702
1702
  function InlineMarkdown({ text, as: Tag = "span", ...rest }) {
1703
1703
  return /* @__PURE__ */ jsx(
1704
1704
  Tag,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsonresume-theme-sidebar",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "Two-column sidebar resume theme with dark sidebar and light main content - ATS-friendly",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "react": "^19.2.0",
29
29
  "react-dom": "^19.2.0",
30
30
  "styled-components": "^6.1.19",
31
- "@jsonresume/core": "0.4.0"
31
+ "@jsonresume/core": "0.4.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@vitejs/plugin-react": "^4.3.4",