Repository navigation
Description
Stage 4 — Readable, configurable exports
Synopsis
Carry the editor's documented <u> underline semantics through the existing HTML/PDF and Pandoc DOCX/EPUB routes.
End goal
Underlined text retains its content and intended presentation in the existing supported export formats, with compatibility claims bounded by reader evidence.
Start after
- Add underline formatting with HTML-backed source preservation #27 — Add underline formatting with HTML-backed source preservation
Start implementation only after every prerequisite is merged into main or has a maintainer-accepted technical freeze recorded in its linked issue. A freeze must identify the exact source/prototype commit and settled contracts; an open draft PR alone is insufficient. For an investigation prerequisite, acceptance must identify the approved design/report revision and prototype commit if one exists.
Fetch current origin/main before branching. If using a freeze, record an integration base containing all required prerequisite changes and link the freeze decisions in the PR. Validate the combined result again after the final prerequisite changes are integrated. The recorded freeze governs any agreed early start while a prerequisite issue remains open.
Agreed scope
- Cover the four existing export formats: HTML, PDF, DOCX, and EPUB. This does not add a new format or extend export to the standalone Electron host.
- Consume the accepted editor/source representation rather than inventing an export-only underline syntax.
- Preserve literal
<u>examples in code/escaped content and existing safe handling of unrelated HTML. - Keep export source capture read-only and preserve all surrounding supported formatting and links.
Acceptance criteria
- Ordinary underline and supported combinations with emphasis, strong text, links, lists, and table cells retain their intended semantics after export.
- HTML/PDF and DOCX/EPUB routes do not turn supported underline markup into visible source/code or silently discard the formatting.
- Literal markup examples remain literal, and unrelated text, code, structure, and source Markdown are preserved.
- Actual reader checks support the claimed formats; unsupported cases or reader limitations appear beside the documented feature.
- The same saved-revision, resource handling, and sanitization boundaries continue to apply.
Verification
- Create synthetic underline fixtures with nested formatting, links, non-ASCII text, tables/lists, and literal markup examples.
- Use actual converters and inspect representative browser, PDF, DOCX, and EPUB readers; distinguish reader checks from structural assertions.
- Exercise save/reopen before export, verify source remains unchanged, and update the export guide and relevant converter regressions.
Source pointers
src/export/html.tssrc/export/pdf.tssrc/export/pandoc.tssrc/export/controller.tssrc/webview/editor.jsmedia/export-help.mdtest/fixtures/exports
Delivery contract
Use the existing supported export host and saved-revision capture; do not add standalone Electron export. Preserve authored Markdown and all code whitespace. Capture presentation settings consistently for each job, update supported translations/documentation, and distinguish structural/converter checks from actual target-reader observations.
Work from the repository root using the Node version in .node-version and the maintained instructions in CONTRIBUTING.md, docs/building.md, and docs/testing/README.md; export changes also follow docs/export-verification.md. Run full compilation after webview JavaScript/CSS, shared-module, or translation changes, plus checks that exercise the changed behavior. Rebuild and reinstall for installed-extension evidence. Report failures/skips honestly; follow required CI and review gates. Update affected documentation and review any committed Markdown in source and rendered form.
Link the PR or investigation to this issue. Keep remediation on the same focused work item where practical. Completion requires the stated evidence and accepted outcome; opening a draft PR does not complete the issue. No deadline or assignee is imposed by this issue.
Activity