jsonresume-theme-executive-slate 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 +20 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# jsonresume-theme-executive-slate
|
|
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
|
@@ -1783,6 +1783,59 @@ dt.span`
|
|
|
1783
1783
|
}
|
|
1784
1784
|
}
|
|
1785
1785
|
`;
|
|
1786
|
+
const ESCAPES = {
|
|
1787
|
+
"&": "&",
|
|
1788
|
+
"<": "<",
|
|
1789
|
+
">": ">",
|
|
1790
|
+
'"': """,
|
|
1791
|
+
"'": "'"
|
|
1792
|
+
};
|
|
1793
|
+
const escapeHtml = (text) => text.replace(/[&<>"']/g, (c) => ESCAPES[c]);
|
|
1794
|
+
const ESCAPABLE = /\\([\\`*_[\]()!#])/g;
|
|
1795
|
+
const CODE = /`([^`]+)`/g;
|
|
1796
|
+
const LINK = /\[([^\]]+)\]\(([^)\s]+)\)/g;
|
|
1797
|
+
const STRONG = /\*\*(?=\S)([^*]*?\S)\*\*|__(?=\S)([^_]*?\S)__/g;
|
|
1798
|
+
const EMPHASIS = /\*(?=\S)([^*]*?\S)\*|(^|[^\p{L}\p{N}_])_(?=\S)([^_]*?\S)_(?![\p{L}\p{N}_])/gu;
|
|
1799
|
+
const safeHref = (url) => /^(https?:\/\/|mailto:)/i.test(url) ? url : void 0;
|
|
1800
|
+
const emphasis = (text, strong, em) => text.replace(STRONG, (_2, a, b2) => strong(a ?? b2)).replace(
|
|
1801
|
+
EMPHASIS,
|
|
1802
|
+
(_2, a, before, b2) => a !== void 0 ? em(a) : `${before}${em(b2)}`
|
|
1803
|
+
);
|
|
1804
|
+
const inline = (text, out) => {
|
|
1805
|
+
const kept = [];
|
|
1806
|
+
const keep = (value) => `${kept.push(value) - 1}`;
|
|
1807
|
+
const marks = (t) => emphasis(t, out.strong, out.em);
|
|
1808
|
+
const rest = text.replace(/\uE000/g, "").replace(ESCAPABLE, (_2, c) => keep(out.text(c))).replace(CODE, (_2, body) => keep(out.code(body))).replace(
|
|
1809
|
+
LINK,
|
|
1810
|
+
(_2, label, url) => keep(out.link(marks(out.text(label)), url))
|
|
1811
|
+
);
|
|
1812
|
+
return marks(out.text(rest)).replace(
|
|
1813
|
+
/\uE000(\d+)\uE000/g,
|
|
1814
|
+
(_2, i) => kept[Number(i)]
|
|
1815
|
+
);
|
|
1816
|
+
};
|
|
1817
|
+
function renderInlineMarkdown(text) {
|
|
1818
|
+
if (typeof text !== "string") return "";
|
|
1819
|
+
return inline(text, {
|
|
1820
|
+
text: escapeHtml,
|
|
1821
|
+
code: (body) => `<code>${escapeHtml(body)}</code>`,
|
|
1822
|
+
link: (label, url) => {
|
|
1823
|
+
const href = safeHref(url);
|
|
1824
|
+
return href ? `<a href="${escapeHtml(href)}">${label}</a>` : label;
|
|
1825
|
+
},
|
|
1826
|
+
strong: (t) => `<strong>${t}</strong>`,
|
|
1827
|
+
em: (t) => `<em>${t}</em>`
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
function InlineMarkdown({ text, as: Tag = "span", ...rest }) {
|
|
1831
|
+
return /* @__PURE__ */ jsx(
|
|
1832
|
+
Tag,
|
|
1833
|
+
{
|
|
1834
|
+
...rest,
|
|
1835
|
+
dangerouslySetInnerHTML: { __html: renderInlineMarkdown(text) }
|
|
1836
|
+
}
|
|
1837
|
+
);
|
|
1838
|
+
}
|
|
1786
1839
|
dt.hr`
|
|
1787
1840
|
border: none;
|
|
1788
1841
|
border-top: 0.5pt solid
|
|
@@ -6403,7 +6456,7 @@ function Resume({ resume }) {
|
|
|
6403
6456
|
] })
|
|
6404
6457
|
] }),
|
|
6405
6458
|
/* @__PURE__ */ jsxs(MainContent, { children: [
|
|
6406
|
-
basics.summary && /* @__PURE__ */ jsx(
|
|
6459
|
+
basics.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: Summary, text: basics.summary }),
|
|
6407
6460
|
work?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
6408
6461
|
/* @__PURE__ */ jsx(StyledSectionTitle, { children: "Professional Experience" }),
|
|
6409
6462
|
work.map((job, index2) => /* @__PURE__ */ jsxs(WorkItem, { children: [
|
|
@@ -6420,16 +6473,16 @@ function Resume({ resume }) {
|
|
|
6420
6473
|
}
|
|
6421
6474
|
) })
|
|
6422
6475
|
] }),
|
|
6423
|
-
job.summary && /* @__PURE__ */ jsx(
|
|
6424
|
-
job.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: job.highlights.map((highlight, i) => /* @__PURE__ */ jsx("li",
|
|
6476
|
+
job.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: job.summary }),
|
|
6477
|
+
job.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: job.highlights.map((highlight, i) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, i)) })
|
|
6425
6478
|
] }, index2))
|
|
6426
6479
|
] }),
|
|
6427
6480
|
projects?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
6428
6481
|
/* @__PURE__ */ jsx(StyledSectionTitle, { children: "Notable Projects" }),
|
|
6429
6482
|
projects.map((project, index2) => /* @__PURE__ */ jsxs(WorkItem, { children: [
|
|
6430
6483
|
/* @__PURE__ */ jsx(Position, { children: project.name }),
|
|
6431
|
-
project.description && /* @__PURE__ */ jsx(
|
|
6432
|
-
project.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: project.highlights.map((highlight, i) => /* @__PURE__ */ jsx("li",
|
|
6484
|
+
project.description && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: project.description }),
|
|
6485
|
+
project.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: project.highlights.map((highlight, i) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, i)) })
|
|
6433
6486
|
] }, index2))
|
|
6434
6487
|
] }),
|
|
6435
6488
|
volunteer?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
@@ -6448,8 +6501,8 @@ function Resume({ resume }) {
|
|
|
6448
6501
|
}
|
|
6449
6502
|
) })
|
|
6450
6503
|
] }),
|
|
6451
|
-
vol.summary && /* @__PURE__ */ jsx(
|
|
6452
|
-
vol.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: vol.highlights.map((highlight, i) => /* @__PURE__ */ jsx("li",
|
|
6504
|
+
vol.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: vol.summary }),
|
|
6505
|
+
vol.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: vol.highlights.map((highlight, i) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, i)) })
|
|
6453
6506
|
] }, index2))
|
|
6454
6507
|
] }),
|
|
6455
6508
|
awards?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
@@ -6461,7 +6514,7 @@ function Resume({ resume }) {
|
|
|
6461
6514
|
award.awarder
|
|
6462
6515
|
] }),
|
|
6463
6516
|
award.date && /* @__PURE__ */ jsx(EducationDate, { children: award.date }),
|
|
6464
|
-
award.summary && /* @__PURE__ */ jsx(
|
|
6517
|
+
award.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: award.summary })
|
|
6465
6518
|
] }, index2))
|
|
6466
6519
|
] }),
|
|
6467
6520
|
certificates?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
@@ -6484,7 +6537,7 @@ function Resume({ resume }) {
|
|
|
6484
6537
|
pub.publisher
|
|
6485
6538
|
] }),
|
|
6486
6539
|
pub.releaseDate && /* @__PURE__ */ jsx(EducationDate, { children: pub.releaseDate }),
|
|
6487
|
-
pub.summary && /* @__PURE__ */ jsx(
|
|
6540
|
+
pub.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: pub.summary })
|
|
6488
6541
|
] }, index2))
|
|
6489
6542
|
] }),
|
|
6490
6543
|
interests?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
package/package.json
CHANGED
package/src/Resume.jsx
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
SectionTitle,
|
|
6
6
|
DateRange,
|
|
7
7
|
ContactInfo,
|
|
8
|
+
InlineMarkdown,
|
|
8
9
|
} from '@jsonresume/core';
|
|
9
10
|
|
|
10
11
|
const Layout = styled.div`
|
|
@@ -361,7 +362,9 @@ function Resume({ resume }) {
|
|
|
361
362
|
</Sidebar>
|
|
362
363
|
|
|
363
364
|
<MainContent>
|
|
364
|
-
{basics.summary &&
|
|
365
|
+
{basics.summary && (
|
|
366
|
+
<InlineMarkdown as={Summary} text={basics.summary} />
|
|
367
|
+
)}
|
|
365
368
|
|
|
366
369
|
{work?.length > 0 && (
|
|
367
370
|
<Section>
|
|
@@ -380,11 +383,13 @@ function Resume({ resume }) {
|
|
|
380
383
|
/>
|
|
381
384
|
</DateText>
|
|
382
385
|
</WorkHeader>
|
|
383
|
-
{job.summary &&
|
|
386
|
+
{job.summary && (
|
|
387
|
+
<InlineMarkdown as={WorkSummary} text={job.summary} />
|
|
388
|
+
)}
|
|
384
389
|
{job.highlights?.length > 0 && (
|
|
385
390
|
<Highlights>
|
|
386
391
|
{job.highlights.map((highlight, i) => (
|
|
387
|
-
<li key={i}
|
|
392
|
+
<InlineMarkdown as="li" key={i} text={highlight} />
|
|
388
393
|
))}
|
|
389
394
|
</Highlights>
|
|
390
395
|
)}
|
|
@@ -400,12 +405,12 @@ function Resume({ resume }) {
|
|
|
400
405
|
<WorkItem key={index}>
|
|
401
406
|
<Position>{project.name}</Position>
|
|
402
407
|
{project.description && (
|
|
403
|
-
<WorkSummary
|
|
408
|
+
<InlineMarkdown as={WorkSummary} text={project.description} />
|
|
404
409
|
)}
|
|
405
410
|
{project.highlights?.length > 0 && (
|
|
406
411
|
<Highlights>
|
|
407
412
|
{project.highlights.map((highlight, i) => (
|
|
408
|
-
<li key={i}
|
|
413
|
+
<InlineMarkdown as="li" key={i} text={highlight} />
|
|
409
414
|
))}
|
|
410
415
|
</Highlights>
|
|
411
416
|
)}
|
|
@@ -433,11 +438,13 @@ function Resume({ resume }) {
|
|
|
433
438
|
</DateText>
|
|
434
439
|
)}
|
|
435
440
|
</WorkHeader>
|
|
436
|
-
{vol.summary &&
|
|
441
|
+
{vol.summary && (
|
|
442
|
+
<InlineMarkdown as={WorkSummary} text={vol.summary} />
|
|
443
|
+
)}
|
|
437
444
|
{vol.highlights?.length > 0 && (
|
|
438
445
|
<Highlights>
|
|
439
446
|
{vol.highlights.map((highlight, i) => (
|
|
440
|
-
<li key={i}
|
|
447
|
+
<InlineMarkdown as="li" key={i} text={highlight} />
|
|
441
448
|
))}
|
|
442
449
|
</Highlights>
|
|
443
450
|
)}
|
|
@@ -454,7 +461,9 @@ function Resume({ resume }) {
|
|
|
454
461
|
<Institution>{award.title}</Institution>
|
|
455
462
|
{award.awarder && <Degree>Awarded by {award.awarder}</Degree>}
|
|
456
463
|
{award.date && <EducationDate>{award.date}</EducationDate>}
|
|
457
|
-
{award.summary &&
|
|
464
|
+
{award.summary && (
|
|
465
|
+
<InlineMarkdown as={WorkSummary} text={award.summary} />
|
|
466
|
+
)}
|
|
458
467
|
</EducationItem>
|
|
459
468
|
))}
|
|
460
469
|
</Section>
|
|
@@ -483,7 +492,9 @@ function Resume({ resume }) {
|
|
|
483
492
|
{pub.releaseDate && (
|
|
484
493
|
<EducationDate>{pub.releaseDate}</EducationDate>
|
|
485
494
|
)}
|
|
486
|
-
{pub.summary &&
|
|
495
|
+
{pub.summary && (
|
|
496
|
+
<InlineMarkdown as={WorkSummary} text={pub.summary} />
|
|
497
|
+
)}
|
|
487
498
|
</EducationItem>
|
|
488
499
|
))}
|
|
489
500
|
</Section>
|