jsonresume-theme-diagonal-accent-bar 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-diagonal-accent-bar
|
|
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
|
|
@@ -6349,7 +6402,7 @@ function Resume({ resume }) {
|
|
|
6349
6402
|
/* @__PURE__ */ jsx(Name, { children: basics.name }),
|
|
6350
6403
|
basics.label && /* @__PURE__ */ jsx(Label, { children: basics.label }),
|
|
6351
6404
|
/* @__PURE__ */ jsx(StyledContactInfo, { basics }),
|
|
6352
|
-
basics.summary && /* @__PURE__ */ jsx(
|
|
6405
|
+
basics.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: Summary, text: basics.summary })
|
|
6353
6406
|
] }),
|
|
6354
6407
|
work?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
6355
6408
|
/* @__PURE__ */ jsx(StyledSectionTitle, { children: "Experience" }),
|
|
@@ -6361,8 +6414,8 @@ function Resume({ resume }) {
|
|
|
6361
6414
|
] }),
|
|
6362
6415
|
/* @__PURE__ */ jsx(DateText, { children: /* @__PURE__ */ jsx(DateRange, { startDate: job.startDate, endDate: job.endDate }) })
|
|
6363
6416
|
] }),
|
|
6364
|
-
job.summary && /* @__PURE__ */ jsx(
|
|
6365
|
-
job.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: job.highlights.map((highlight, i) => /* @__PURE__ */ jsx("li",
|
|
6417
|
+
job.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: job.summary }),
|
|
6418
|
+
job.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: job.highlights.map((highlight, i) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, i)) })
|
|
6366
6419
|
] }, index))
|
|
6367
6420
|
] }),
|
|
6368
6421
|
skills?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
@@ -6389,8 +6442,8 @@ function Resume({ resume }) {
|
|
|
6389
6442
|
/* @__PURE__ */ jsx(StyledSectionTitle, { children: "Projects" }),
|
|
6390
6443
|
projects.map((project, index) => /* @__PURE__ */ jsxs(WorkItem, { children: [
|
|
6391
6444
|
/* @__PURE__ */ jsx(Position, { children: project.name }),
|
|
6392
|
-
project.description && /* @__PURE__ */ jsx(
|
|
6393
|
-
project.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: project.highlights.map((highlight, i) => /* @__PURE__ */ jsx("li",
|
|
6445
|
+
project.description && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: project.description }),
|
|
6446
|
+
project.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: project.highlights.map((highlight, i) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, i)) })
|
|
6394
6447
|
] }, index))
|
|
6395
6448
|
] }),
|
|
6396
6449
|
volunteer?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
@@ -6409,8 +6462,8 @@ function Resume({ resume }) {
|
|
|
6409
6462
|
}
|
|
6410
6463
|
) })
|
|
6411
6464
|
] }),
|
|
6412
|
-
vol.summary && /* @__PURE__ */ jsx(
|
|
6413
|
-
vol.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: vol.highlights.map((highlight, i) => /* @__PURE__ */ jsx("li",
|
|
6465
|
+
vol.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: vol.summary }),
|
|
6466
|
+
vol.highlights?.length > 0 && /* @__PURE__ */ jsx(Highlights, { children: vol.highlights.map((highlight, i) => /* @__PURE__ */ jsx(InlineMarkdown, { as: "li", text: highlight }, i)) })
|
|
6414
6467
|
] }, index))
|
|
6415
6468
|
] }),
|
|
6416
6469
|
awards?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
@@ -6422,7 +6475,7 @@ function Resume({ resume }) {
|
|
|
6422
6475
|
award.awarder
|
|
6423
6476
|
] }),
|
|
6424
6477
|
award.date && /* @__PURE__ */ jsx(EducationDate, { children: award.date }),
|
|
6425
|
-
award.summary && /* @__PURE__ */ jsx(
|
|
6478
|
+
award.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: award.summary })
|
|
6426
6479
|
] }, index))
|
|
6427
6480
|
] }),
|
|
6428
6481
|
publications?.length > 0 && /* @__PURE__ */ jsxs(Section, { children: [
|
|
@@ -6434,7 +6487,7 @@ function Resume({ resume }) {
|
|
|
6434
6487
|
pub.publisher
|
|
6435
6488
|
] }),
|
|
6436
6489
|
pub.releaseDate && /* @__PURE__ */ jsx(EducationDate, { children: pub.releaseDate }),
|
|
6437
|
-
pub.summary && /* @__PURE__ */ jsx(
|
|
6490
|
+
pub.summary && /* @__PURE__ */ jsx(InlineMarkdown, { as: WorkSummary, text: pub.summary })
|
|
6438
6491
|
] }, index))
|
|
6439
6492
|
] }),
|
|
6440
6493
|
certificates?.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`
|
|
@@ -286,7 +287,9 @@ function Resume({ resume }) {
|
|
|
286
287
|
<Name>{basics.name}</Name>
|
|
287
288
|
{basics.label && <Label>{basics.label}</Label>}
|
|
288
289
|
<StyledContactInfo basics={basics} />
|
|
289
|
-
{basics.summary &&
|
|
290
|
+
{basics.summary && (
|
|
291
|
+
<InlineMarkdown as={Summary} text={basics.summary} />
|
|
292
|
+
)}
|
|
290
293
|
</Header>
|
|
291
294
|
|
|
292
295
|
{work?.length > 0 && (
|
|
@@ -303,11 +306,13 @@ function Resume({ resume }) {
|
|
|
303
306
|
<DateRange startDate={job.startDate} endDate={job.endDate} />
|
|
304
307
|
</DateText>
|
|
305
308
|
</WorkHeader>
|
|
306
|
-
{job.summary &&
|
|
309
|
+
{job.summary && (
|
|
310
|
+
<InlineMarkdown as={WorkSummary} text={job.summary} />
|
|
311
|
+
)}
|
|
307
312
|
{job.highlights?.length > 0 && (
|
|
308
313
|
<Highlights>
|
|
309
314
|
{job.highlights.map((highlight, i) => (
|
|
310
|
-
<li key={i}
|
|
315
|
+
<InlineMarkdown as="li" key={i} text={highlight} />
|
|
311
316
|
))}
|
|
312
317
|
</Highlights>
|
|
313
318
|
)}
|
|
@@ -357,12 +362,12 @@ function Resume({ resume }) {
|
|
|
357
362
|
<WorkItem key={index}>
|
|
358
363
|
<Position>{project.name}</Position>
|
|
359
364
|
{project.description && (
|
|
360
|
-
<WorkSummary
|
|
365
|
+
<InlineMarkdown as={WorkSummary} text={project.description} />
|
|
361
366
|
)}
|
|
362
367
|
{project.highlights?.length > 0 && (
|
|
363
368
|
<Highlights>
|
|
364
369
|
{project.highlights.map((highlight, i) => (
|
|
365
|
-
<li key={i}
|
|
370
|
+
<InlineMarkdown as="li" key={i} text={highlight} />
|
|
366
371
|
))}
|
|
367
372
|
</Highlights>
|
|
368
373
|
)}
|
|
@@ -390,11 +395,13 @@ function Resume({ resume }) {
|
|
|
390
395
|
</DateText>
|
|
391
396
|
)}
|
|
392
397
|
</WorkHeader>
|
|
393
|
-
{vol.summary &&
|
|
398
|
+
{vol.summary && (
|
|
399
|
+
<InlineMarkdown as={WorkSummary} text={vol.summary} />
|
|
400
|
+
)}
|
|
394
401
|
{vol.highlights?.length > 0 && (
|
|
395
402
|
<Highlights>
|
|
396
403
|
{vol.highlights.map((highlight, i) => (
|
|
397
|
-
<li key={i}
|
|
404
|
+
<InlineMarkdown as="li" key={i} text={highlight} />
|
|
398
405
|
))}
|
|
399
406
|
</Highlights>
|
|
400
407
|
)}
|
|
@@ -411,7 +418,9 @@ function Resume({ resume }) {
|
|
|
411
418
|
<Institution>{award.title}</Institution>
|
|
412
419
|
{award.awarder && <Degree>Awarded by {award.awarder}</Degree>}
|
|
413
420
|
{award.date && <EducationDate>{award.date}</EducationDate>}
|
|
414
|
-
{award.summary &&
|
|
421
|
+
{award.summary && (
|
|
422
|
+
<InlineMarkdown as={WorkSummary} text={award.summary} />
|
|
423
|
+
)}
|
|
415
424
|
</EducationItem>
|
|
416
425
|
))}
|
|
417
426
|
</Section>
|
|
@@ -427,7 +436,9 @@ function Resume({ resume }) {
|
|
|
427
436
|
{pub.releaseDate && (
|
|
428
437
|
<EducationDate>{pub.releaseDate}</EducationDate>
|
|
429
438
|
)}
|
|
430
|
-
{pub.summary &&
|
|
439
|
+
{pub.summary && (
|
|
440
|
+
<InlineMarkdown as={WorkSummary} text={pub.summary} />
|
|
441
|
+
)}
|
|
431
442
|
</EducationItem>
|
|
432
443
|
))}
|
|
433
444
|
</Section>
|