From ec3d53ea7e619e57314a6e971132a03b633e8ffc Mon Sep 17 00:00:00 2001 From: Amit Haridas Date: Thu, 23 Jul 2026 00:27:31 +0530 Subject: [PATCH] chore: lint cleanup + 5.1.0 changelog entry - Drop unused imports/vars (withEpubEmbedFontArgs, monoPdfHeaderDir, _e) - Append CHANGELOG entry summarising the parity work and the Markdown Converter React rename --- CHANGELOG.md | 15 +++++++++++++++ src/main/DocxFontEmbedder.js | 1 - src/main/index.js | 10 +++------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 883cb3e..57ef65b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,3 +50,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 9 dead IPC channels from `src/preload.js`: `toggle-command-palette`, `print-preview`, `print-preview-styled`, `open-ascii-generator`, `open-table-generator`, `show-ascii-generator`, `show-ascii-generator-window`, `show-table-generator`, `show-table-generator-window` [5.0.0]: https://github.com/amitwh/markdown-converter/releases/tag/v5.0.0 + +## [5.1.0] - 2026-07-23 - react-electron parity + +### Added +- **Monospace font embedding** — bundles JetBrains Mono + Fira Code TTFs and embeds the active font into PDF (xelatex fontspec), DOCX (post-pandoc zip patch with `fontTable.xml`), EPUB (`--epub-embed-font` + manifest), and HTML (woff2 base64 in CSS) exports. ASCII art and code blocks now render with the exact same font across machines. +- **Monospace settings** — `get-monospace-settings` / `set-monospace-settings` IPC, with `monospaceFont` (`jetbrains-mono` / `fira-code`) and `monospaceLigatures` (boolean). +- **Renderer body-class toggle** — `useMonospaceClasses` hook toggles `mono-jetbrains-mono` / `mono-fira-code` and `mono-ligatures-on` / `mono-ligatures-off` on `document.body`, driving `--font-mono-active` and `--font-mono-feature` CSS tokens. + +### Changed +- **App renamed to Markdown Converter React** (`com.concreteinfo.markdownconverter.react`, npm name `markdown-converter-react`, deb `markdown-converter-react_*_amd64.deb`) so the dev build coexists with the installed `markdown-converter` deb without single-instance lock conflicts. +- Window title shows `Markdown Converter — React Dev` in dev mode. +- `download-tools.js` pins Fira Code to release `6.2` with SHA-256 digests verified before atomic rename; downloads refuse to start on digest mismatch. + +### Security +- `PdfFontHeader` uses `fs.mkdtempSync` for an exclusive temp directory; the caller unlinks it after pandoc consumes the header (no racy `Date.now()+pid` filenames). diff --git a/src/main/DocxFontEmbedder.js b/src/main/DocxFontEmbedder.js index 8ff701a..7bf2d2d 100644 --- a/src/main/DocxFontEmbedder.js +++ b/src/main/DocxFontEmbedder.js @@ -1,7 +1,6 @@ 'use strict'; const fs = require('fs'); -const path = require('path'); const JSZip = require('jszip'); const FONT_TABLE_PATH = 'word/fontTable.xml'; diff --git a/src/main/index.js b/src/main/index.js index fad7047..64a4cc1 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -18,7 +18,7 @@ const { createMainWindow } = require('./window'); const MonospaceFontConfig = require('./MonospaceFontConfig'); const { buildPdfFontHeader } = require('./PdfFontHeader'); const { embedDocxFont } = require('./DocxFontEmbedder'); -const { withEpubEmbedFontArgs, embedEpubFont } = require('./EpubFontEmbedder'); +const { withEpubEmbedFontArgs: _withEpubEmbedFontArgs, embedEpubFont } = require('./EpubFontEmbedder'); const { buildExportCss } = require('./ExportCss'); const { safeMonospaceSettings, DEFAULT_SETTINGS: MONO_DEFAULTS } = require('./settings/monospaceSettings'); @@ -1600,7 +1600,6 @@ function performExportWithOptions(format, options) { // active monospace font (xelatex fontspec) so ASCII art renders // identically across machines. const monoCtx = getActiveMonospaceContext(); - let monoPdfHeaderDir = null; if (monoCtx.ttf) { try { const built = buildPdfFontHeader( @@ -1609,7 +1608,6 @@ function performExportWithOptions(format, options) { MonospaceFontConfig.getActiveFamily(monoCtx.settings) ); pandocCmd += ` --include-in-header="${built.headerPath}"`; - monoPdfHeaderDir = built.dir; } catch (e) { console.error('[monospace] PDF header build failed (non-fatal):', e.message); } @@ -1986,10 +1984,8 @@ function exportWithPandoc(pandocCmd, outputFile, format) { // Headers/footers are applied only for DOCX format showExportSuccess(outputFile); - cleanupMonoHeader(); - } else { - cleanupMonoHeader(); } + cleanupMonoHeader(); }); } @@ -2101,7 +2097,7 @@ function exportToHTML(outputFile) { const woff2Path = path.join(path.dirname(monoCtx.ttf || ''), woff2Name); if (!fs.existsSync(woff2Path)) return ''; return buildExportCss(monoCtx.settings, { woff2: fs.readFileSync(woff2Path) }); - } catch (e) { + } catch (_e) { return ''; } })()}