@phuthuycoding/markcv 0.1.3 → 0.1.4

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
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.4] - 2026-09-06
11
+
12
+ ### Fixed
13
+
14
+ - HTML comments were printed into the PDF instead of being dropped. With
15
+ markdown-it's `html: false`, comments are escaped into visible text rather than
16
+ ignored, so a file carrying `<!-- markcv:no-build -->` rendered that marker at
17
+ the top of the page. Comments are metadata for tooling, never content, and are
18
+ now stripped before rendering.
19
+
10
20
  ## [0.1.3] - 2026-09-06
11
21
 
12
22
  ### Changed
@@ -73,7 +83,8 @@ First release.
73
83
  - Two ATS-safe themes: `classic` and `compact`.
74
84
  - Example CVs in `examples/`, with and without a portrait photo.
75
85
 
76
- [Unreleased]: https://github.com/phuthuycoding/markcv/compare/v0.1.3...HEAD
86
+ [Unreleased]: https://github.com/phuthuycoding/markcv/compare/v0.1.4...HEAD
87
+ [0.1.4]: https://github.com/phuthuycoding/markcv/compare/v0.1.3...v0.1.4
77
88
  [0.1.3]: https://github.com/phuthuycoding/markcv/compare/v0.1.2...v0.1.3
78
89
  [0.1.2]: https://github.com/phuthuycoding/markcv/compare/v0.1.1...v0.1.2
79
90
  [0.1.1]: https://github.com/phuthuycoding/markcv/compare/v0.1.0...v0.1.1
package/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![CI](https://github.com/phuthuycoding/markcv/actions/workflows/ci.yml/badge.svg)](https://github.com/phuthuycoding/markcv/actions/workflows/ci.yml)
4
4
  [![npm](https://img.shields.io/npm/v/@phuthuycoding/markcv.svg)](https://www.npmjs.com/package/@phuthuycoding/markcv)
5
+ [![docs](https://img.shields.io/badge/docs-markcv-c96442)](https://phuthuycoding.github.io/markcv/)
5
6
 
6
7
  <p align="center">
7
8
  <img src="docs/screenshots/engineering-lead.png" width="640" alt="Two-page ATS-safe resume PDF generated from Markdown by markcv">
@@ -245,6 +246,11 @@ markcv exists for the part that comes after the rendering works:
245
246
  | **Job-description match** | — | missing requirements, SKILLS-only claims, unrelated bullets |
246
247
  | **Usable by an AI agent** | — | MCP server, structured JSON |
247
248
 
249
+ ## Author
250
+
251
+ Built by [Ta Manh Quyen](https://quyentm.dev) — a staff engineer who got tired of guessing
252
+ why a CV spilled onto a third page. More writing at [quyentm.dev](https://quyentm.dev).
253
+
248
254
  ## License
249
255
 
250
256
  MIT
@@ -1,5 +1,5 @@
1
1
  import type { CvDoc } from "../types.js";
2
- export declare function parseCv(raw: string): CvDoc;
2
+ export declare function parseCv(input: string): CvDoc;
3
3
  /**
4
4
  * Markdown -> page body HTML.
5
5
  * The header (name + contact lines) is wrapped in .header so the portrait can be
@@ -1,10 +1,19 @@
1
1
  import MarkdownIt from "markdown-it";
2
2
  const md = new MarkdownIt({ html: false, linkify: false, typographer: false });
3
+ /**
4
+ * HTML comments carry metadata for tools (markcv:no-build and friends), never
5
+ * content. With `html: false` markdown-it escapes them into visible text rather
6
+ * than dropping them, so strip them before rendering.
7
+ */
8
+ function stripComments(raw) {
9
+ return raw.replace(/<!--[\s\S]*?-->/g, "");
10
+ }
3
11
  /** A header contact line: `**Label:** value` (no `|`, unlike a job-title line). */
4
12
  const CONTACT_RE = /^<p><strong>[^<]+:<\/strong>[^|]*<\/p>$/;
5
13
  /** A job-title line: `**Job Title** | 2020 - 2021`. */
6
14
  const META_RE = /^<p><strong>.*\|.*<\/p>$/;
7
- export function parseCv(raw) {
15
+ export function parseCv(input) {
16
+ const raw = stripComments(input);
8
17
  const lines = raw.split("\n");
9
18
  const sections = [];
10
19
  lines.forEach((line, i) => {
@@ -23,7 +32,7 @@ export function parseCv(raw) {
23
32
  * be laid out as one block.
24
33
  */
25
34
  export function renderBody(raw, photoHtml) {
26
- const html = md.render(raw);
35
+ const html = md.render(stripComments(raw));
27
36
  const blocks = html.split("\n").filter((l) => l.trim() !== "");
28
37
  const out = [];
29
38
  let headerOpen = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phuthuycoding/markcv",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Markdown resume builder that lints your CV and explains why it will not fit two pages. ATS-safe PDF, job-description tailoring, CLI + MCP server for AI agents.",
5
5
  "type": "module",
6
6
  "bin": {