mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 10:00:17 +05:30
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
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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';
|
||||
|
||||
+3
-7
@@ -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 '';
|
||||
}
|
||||
})()}
|
||||
|
||||
Reference in New Issue
Block a user