jsonresume-theme-two-column-modernist 1.1.12 → 1.1.13
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 +6 -0
- package/dist/index.js +62 -9
- package/package.json +1 -1
- package/src/Resume.jsx +16 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# jsonresume-theme-two-column-modernist
|
|
2
2
|
|
|
3
|
+
## 1.1.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2b3af11: Render inline Markdown (bold, emphasis, code, links) in summaries, descriptions and highlights with the shared renderer from @jsonresume/core (#600).
|
|
8
|
+
|
|
3
9
|
## 1.1.12
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1694,6 +1694,59 @@ dt.span`
|
|
|
1694
1694
|
}
|
|
1695
1695
|
}
|
|
1696
1696
|
`;
|
|
1697
|
+
const ESCAPES = {
|
|
1698
|
+
"&": "&",
|
|
1699
|
+
"<": "<",
|
|
1700
|
+
">": ">",
|
|
1701
|
+
'"': """,
|
|
1702
|
+
"'": "'"
|
|
1703
|
+
};
|
|
1704
|
+
const escapeHtml = (text) => text.replace(/[&<>"']/g, (c) => ESCAPES[c]);
|
|
1705
|
+
const ESCAPABLE = /\\([\\`*_[\]()!#])/g;
|
|
1706
|
+
const CODE = /`([^`]+)`/g;
|
|
1707
|
+
const LINK = /\[([^\]]+)\]\(([^)\s]+)\)/g;
|
|
1708
|
+
const STRONG = /\*\*(?=\S)([^*]*?\S)\*\*|__(?=\S)([^_]*?\S)__/g;
|
|
1709
|
+
const EMPHASIS = /\*(?=\S)([^*]*?\S)\*|(^|[^\p{L}\p{N}_])_(?=\S)([^_]*?\S)_(?![\p{L}\p{N}_])/gu;
|
|
1710
|
+
const safeHref = (url) => /^(https?:\/\/|mailto:)/i.test(url) ? url : void 0;
|
|
1711
|
+
const emphasis = (text, strong, em) => text.replace(STRONG, (_2, a, b2) => strong(a ?? b2)).replace(
|
|
1712
|
+
EMPHASIS,
|
|
1713
|
+
(_2, a, before, b2) => a !== void 0 ? em(a) : `${before}${em(b2)}`
|
|
1714
|
+
);
|
|
1715
|
+
const inline = (text, out) => {
|
|
1716
|
+
const kept = [];
|
|
1717
|
+
const keep = (value) => `${kept.push(value) - 1}`;
|
|
1718
|
+
const marks = (t) => emphasis(t, out.strong, out.em);
|
|
1719
|
+
const rest = text.replace(/\uE000/g, "").replace(ESCAPABLE, (_2, c) => keep(out.text(c))).replace(CODE, (_2, body) => keep(out.code(body))).replace(
|
|
1720
|
+
LINK,
|
|
1721
|
+
(_2, label, url) => keep(out.link(marks(out.text(label)), url))
|
|
1722
|
+
);
|
|
1723
|
+
return marks(out.text(rest)).replace(
|
|
1724
|
+
/\uE000(\d+)\uE000/g,
|
|
1725
|
+
(_2, i) => kept[Number(i)]
|
|
1726
|
+
);
|
|
1727
|
+
};
|
|
1728
|
+
function renderInlineMarkdown(text) {
|
|
1729
|
+
if (typeof text !== "string") return "";
|
|
1730
|
+
return inline(text, {
|
|
1731
|
+
text: escapeHtml,
|
|
1732
|
+
code: (body) => `<code>${escapeHtml(body)}</code>`,
|
|
1733
|
+
link: (label, url) => {
|
|
1734
|
+
const href = safeHref(url);
|
|
1735
|
+
return href ? `<a href="${escapeHtml(href)}">${label}</a>` : label;
|
|
1736
|
+
},
|
|
1737
|
+
strong: (t) => `<strong>${t}</strong>`,
|
|
1738
|
+
em: (t) => `<em>${t}</em>`
|
|
1739
|
+
});
|
|
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(
|
|
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(
|
|
6313
|
-
job.highlights && job.highlights.length > 0 && /* @__PURE__ */ jsx(HighlightsList, { children: job.highlights.map((highlight, j2) => /* @__PURE__ */ jsx(
|
|
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(
|
|
6357
|
-
project.highlights && project.highlights.length > 0 && /* @__PURE__ */ jsx(HighlightsList, { children: project.highlights.map((highlight, j2) => /* @__PURE__ */ jsx(
|
|
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(
|
|
6393
|
-
vol.highlights && vol.highlights.length > 0 && /* @__PURE__ */ jsx(HighlightsList, { children: vol.highlights.map((highlight, j2) => /* @__PURE__ */ jsx(
|
|
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(
|
|
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(
|
|
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
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
|
|
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 &&
|
|
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}
|
|
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
|
|
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}
|
|
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 &&
|
|
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}
|
|
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
|
|
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 &&
|
|
640
|
+
{pub.summary && (
|
|
641
|
+
<InlineMarkdown as={EntryDescription} text={pub.summary} />
|
|
642
|
+
)}
|
|
637
643
|
{pub.url && (
|
|
638
644
|
<div>
|
|
639
645
|
<a
|