jsonresume-theme-two-column-modernist 1.1.12 → 1.1.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,18 @@
1
1
  # jsonresume-theme-two-column-modernist
2
2
 
3
+ ## 1.1.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [601e883]
8
+ - @jsonresume/core@0.4.1
9
+
10
+ ## 1.1.13
11
+
12
+ ### Patch Changes
13
+
14
+ - 2b3af11: Render inline Markdown (bold, emphasis, code, links) in summaries, descriptions and highlights with the shared renderer from @jsonresume/core (#600).
15
+
3
16
  ## 1.1.12
4
17
 
5
18
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1424,6 +1424,50 @@ dt.span`
1424
1424
  margin-right: 8px;
1425
1425
  font-size: 1.2em;
1426
1426
  `;
1427
+ const ESCAPES = {
1428
+ "&": "&",
1429
+ "<": "&lt;",
1430
+ ">": "&gt;",
1431
+ '"': "&quot;",
1432
+ "'": "&#39;"
1433
+ };
1434
+ const escapeHtml = (text) => text.replace(/[&<>"']/g, (c) => ESCAPES[c]);
1435
+ const ESCAPABLE = /\\([\\`*_[\]()!#])/g;
1436
+ const CODE = /`([^`]+)`/g;
1437
+ const LINK = /\[([^\]]+)\]\(([^)\s]+)\)/g;
1438
+ const STRONG = /\*\*(?=\S)([^*]*?\S)\*\*|__(?=\S)([^_]*?\S)__/g;
1439
+ const EMPHASIS = /\*(?=\S)([^*]*?\S)\*|(^|[^\p{L}\p{N}_])_(?=\S)([^_]*?\S)_(?![\p{L}\p{N}_])/gu;
1440
+ const safeHref = (url) => /^(https?:\/\/|mailto:)/i.test(url) ? url : void 0;
1441
+ const emphasis = (text, strong, em) => text.replace(STRONG, (_2, a, b2) => strong(a ?? b2)).replace(
1442
+ EMPHASIS,
1443
+ (_2, a, before, b2) => a !== void 0 ? em(a) : `${before}${em(b2)}`
1444
+ );
1445
+ const inline = (text, out) => {
1446
+ const kept = [];
1447
+ const keep = (value) => `${kept.push(value) - 1}`;
1448
+ const marks = (t) => emphasis(t, out.strong, out.em);
1449
+ const rest = text.replace(/\uE000/g, "").replace(ESCAPABLE, (_2, c) => keep(out.text(c))).replace(CODE, (_2, body) => keep(out.code(body))).replace(
1450
+ LINK,
1451
+ (_2, label, url) => keep(out.link(marks(out.text(label)), url))
1452
+ );
1453
+ return marks(out.text(rest)).replace(
1454
+ /\uE000(\d+)\uE000/g,
1455
+ (_2, i) => kept[Number(i)]
1456
+ );
1457
+ };
1458
+ function renderInlineMarkdown(text) {
1459
+ if (typeof text !== "string") return "";
1460
+ return inline(text, {
1461
+ text: escapeHtml,
1462
+ code: (body) => `<code>${escapeHtml(body)}</code>`,
1463
+ link: (label, url) => {
1464
+ const href = safeHref(url);
1465
+ return href ? `<a href="${escapeHtml(href)}">${label}</a>` : label;
1466
+ },
1467
+ strong: (t) => `<strong>${t}</strong>`,
1468
+ em: (t) => `<em>${t}</em>`
1469
+ });
1470
+ }
1427
1471
  dt.div`
1428
1472
  margin-bottom: ${(props) => props.theme?.spacing?.item || "var(--resume-space-item, 1rem)"};
1429
1473
 
@@ -1694,6 +1738,15 @@ dt.span`
1694
1738
  }
1695
1739
  }
1696
1740
  `;
1741
+ function InlineMarkdown({ text, as: Tag = "span", ...rest }) {
1742
+ return /* @__PURE__ */ jsx(
1743
+ Tag,
1744
+ {
1745
+ ...rest,
1746
+ dangerouslySetInnerHTML: { __html: renderInlineMarkdown(text) }
1747
+ }
1748
+ );
1749
+ }
1697
1750
  dt.hr`
1698
1751
  border: none;
1699
1752
  border-top: 0.5pt solid
@@ -6295,7 +6348,7 @@ function Languages({ languages }) {
6295
6348
  }
6296
6349
  function SummarySection({ summary }) {
6297
6350
  if (!summary) return null;
6298
- return /* @__PURE__ */ jsx(Section, { children: /* @__PURE__ */ jsx(Summary, { children: summary }) });
6351
+ return /* @__PURE__ */ jsx(Section, { children: /* @__PURE__ */ jsx(InlineMarkdown, { as: Summary, text: summary }) });
6299
6352
  }
6300
6353
  function WorkSection({ work }) {
6301
6354
  if (!work || work.length === 0) return null;
@@ -6309,8 +6362,8 @@ function WorkSection({ work }) {
6309
6362
  (job.startDate || job.endDate) && /* @__PURE__ */ jsx(EntryDate, { children: /* @__PURE__ */ jsx(DateRange, { startDate: job.startDate, endDate: job.endDate }) })
6310
6363
  ] })
6311
6364
  ] }),
6312
- job.summary && /* @__PURE__ */ jsx(EntryDescription, { children: job.summary }),
6313
- job.highlights && job.highlights.length > 0 && /* @__PURE__ */ jsx(HighlightsList, { children: job.highlights.map((highlight, j2) => /* @__PURE__ */ jsx(HighlightItem, { children: highlight }, j2)) })
6365
+ job.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: EntryDescription, text: job.summary }),
6366
+ job.highlights && job.highlights.length > 0 && /* @__PURE__ */ jsx(HighlightsList, { children: job.highlights.map((highlight, j2) => /* @__PURE__ */ jsx(InlineMarkdown, { as: HighlightItem, text: highlight }, j2)) })
6314
6367
  ] }, i))
6315
6368
  ] });
6316
6369
  }
@@ -6353,8 +6406,8 @@ function ProjectsSection({ projects }) {
6353
6406
  }
6354
6407
  ) }) })
6355
6408
  ] }),
6356
- project.description && /* @__PURE__ */ jsx(EntryDescription, { children: project.description }),
6357
- project.highlights && project.highlights.length > 0 && /* @__PURE__ */ jsx(HighlightsList, { children: project.highlights.map((highlight, j2) => /* @__PURE__ */ jsx(HighlightItem, { children: highlight }, j2)) }),
6409
+ project.description && /* @__PURE__ */ jsx(InlineMarkdown, { as: EntryDescription, text: project.description }),
6410
+ project.highlights && project.highlights.length > 0 && /* @__PURE__ */ jsx(HighlightsList, { children: project.highlights.map((highlight, j2) => /* @__PURE__ */ jsx(InlineMarkdown, { as: HighlightItem, text: highlight }, j2)) }),
6358
6411
  project.url && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
6359
6412
  "a",
6360
6413
  {
@@ -6389,8 +6442,8 @@ function VolunteerSection({ volunteer }) {
6389
6442
  (vol.startDate || vol.endDate) && /* @__PURE__ */ jsx(EntryDate, { children: /* @__PURE__ */ jsx(DateRange, { startDate: vol.startDate, endDate: vol.endDate }) })
6390
6443
  ] })
6391
6444
  ] }),
6392
- vol.summary && /* @__PURE__ */ jsx(EntryDescription, { children: vol.summary }),
6393
- vol.highlights && vol.highlights.length > 0 && /* @__PURE__ */ jsx(HighlightsList, { children: vol.highlights.map((highlight, j2) => /* @__PURE__ */ jsx(HighlightItem, { children: highlight }, j2)) })
6445
+ vol.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: EntryDescription, text: vol.summary }),
6446
+ vol.highlights && vol.highlights.length > 0 && /* @__PURE__ */ jsx(HighlightsList, { children: vol.highlights.map((highlight, j2) => /* @__PURE__ */ jsx(InlineMarkdown, { as: HighlightItem, text: highlight }, j2)) })
6394
6447
  ] }, i))
6395
6448
  ] });
6396
6449
  }
@@ -6406,7 +6459,7 @@ function AwardsSection({ awards }) {
6406
6459
  award.date && /* @__PURE__ */ jsx(EntryDate, { children: award.date })
6407
6460
  ] })
6408
6461
  ] }),
6409
- award.summary && /* @__PURE__ */ jsx(EntryDescription, { children: award.summary })
6462
+ award.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: EntryDescription, text: award.summary })
6410
6463
  ] }, i))
6411
6464
  ] });
6412
6465
  }
@@ -6446,7 +6499,7 @@ function PublicationsSection({ publications }) {
6446
6499
  pub.releaseDate && /* @__PURE__ */ jsx(EntryDate, { children: pub.releaseDate })
6447
6500
  ] })
6448
6501
  ] }),
6449
- pub.summary && /* @__PURE__ */ jsx(EntryDescription, { children: pub.summary }),
6502
+ pub.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: EntryDescription, text: pub.summary }),
6450
6503
  pub.url && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
6451
6504
  "a",
6452
6505
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsonresume-theme-two-column-modernist",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "type": "module",
5
5
  "description": "Structured European minimalism with asymmetric two-column layout and neutral grotesk typography",
6
6
  "main": "./dist/index.js",
@@ -15,7 +15,7 @@
15
15
  "swiss-design"
16
16
  ],
17
17
  "dependencies": {
18
- "@jsonresume/core": "0.4.0",
18
+ "@jsonresume/core": "0.4.1",
19
19
  "styled-components": "6.1.19"
20
20
  },
21
21
  "peerDependencies": {
package/src/Resume.jsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
- import { safeUrl, DateRange } from '@jsonresume/core';
3
+ import { safeUrl, DateRange, InlineMarkdown } from '@jsonresume/core';
4
4
 
5
5
  // Layout
6
6
  const Container = styled.div`
@@ -374,7 +374,7 @@ function SummarySection({ summary }) {
374
374
 
375
375
  return (
376
376
  <Section>
377
- <Summary>{summary}</Summary>
377
+ <InlineMarkdown as={Summary} text={summary} />
378
378
  </Section>
379
379
  );
380
380
  }
@@ -398,11 +398,13 @@ function WorkSection({ work }) {
398
398
  )}
399
399
  </EntryMeta>
400
400
  </EntryHeader>
401
- {job.summary && <EntryDescription>{job.summary}</EntryDescription>}
401
+ {job.summary && (
402
+ <InlineMarkdown as={EntryDescription} text={job.summary} />
403
+ )}
402
404
  {job.highlights && job.highlights.length > 0 && (
403
405
  <HighlightsList>
404
406
  {job.highlights.map((highlight, j) => (
405
- <HighlightItem key={j}>{highlight}</HighlightItem>
407
+ <InlineMarkdown as={HighlightItem} key={j} text={highlight} />
406
408
  ))}
407
409
  </HighlightsList>
408
410
  )}
@@ -473,12 +475,12 @@ function ProjectsSection({ projects }) {
473
475
  )}
474
476
  </EntryHeader>
475
477
  {project.description && (
476
- <EntryDescription>{project.description}</EntryDescription>
478
+ <InlineMarkdown as={EntryDescription} text={project.description} />
477
479
  )}
478
480
  {project.highlights && project.highlights.length > 0 && (
479
481
  <HighlightsList>
480
482
  {project.highlights.map((highlight, j) => (
481
- <HighlightItem key={j}>{highlight}</HighlightItem>
483
+ <InlineMarkdown as={HighlightItem} key={j} text={highlight} />
482
484
  ))}
483
485
  </HighlightsList>
484
486
  )}
@@ -542,11 +544,13 @@ function VolunteerSection({ volunteer }) {
542
544
  )}
543
545
  </EntryMeta>
544
546
  </EntryHeader>
545
- {vol.summary && <EntryDescription>{vol.summary}</EntryDescription>}
547
+ {vol.summary && (
548
+ <InlineMarkdown as={EntryDescription} text={vol.summary} />
549
+ )}
546
550
  {vol.highlights && vol.highlights.length > 0 && (
547
551
  <HighlightsList>
548
552
  {vol.highlights.map((highlight, j) => (
549
- <HighlightItem key={j}>{highlight}</HighlightItem>
553
+ <InlineMarkdown as={HighlightItem} key={j} text={highlight} />
550
554
  ))}
551
555
  </HighlightsList>
552
556
  )}
@@ -574,7 +578,7 @@ function AwardsSection({ awards }) {
574
578
  </EntryMeta>
575
579
  </EntryHeader>
576
580
  {award.summary && (
577
- <EntryDescription>{award.summary}</EntryDescription>
581
+ <InlineMarkdown as={EntryDescription} text={award.summary} />
578
582
  )}
579
583
  </Entry>
580
584
  ))}
@@ -633,7 +637,9 @@ function PublicationsSection({ publications }) {
633
637
  {pub.releaseDate && <EntryDate>{pub.releaseDate}</EntryDate>}
634
638
  </EntryMeta>
635
639
  </EntryHeader>
636
- {pub.summary && <EntryDescription>{pub.summary}</EntryDescription>}
640
+ {pub.summary && (
641
+ <InlineMarkdown as={EntryDescription} text={pub.summary} />
642
+ )}
637
643
  {pub.url && (
638
644
  <div>
639
645
  <a