Files
Marc WäckerlinandClaude Opus 5.5 d7aac52ac7 1.0.2: converter searches no subfolders, safer filters, forms, links and watermark
A document at the root of a checkout of 68377 folders needed 56 minutes,
because the converter named the suite, the document folder and the build folder
with `//` in TEXINPUTS; it now names them without recursion and the same
document converts in 11.5 seconds. A file below the document no longer replaces
a package of TeX Live.

The security review of the pending changes found four defects, each fixed with
a test proven red against the old files and green against the new ones twice:
an HTML table read in an empty sandbox, so an iframe opens no address; form
labels written through the LaTeX writer, so they are set as text; the form
pattern scans a line once instead of quadratically; a kept build folder no
longer lays the links of an earlier drawing over a new one. The form tests
remove the PDF of an earlier run before each conversion.

Also carried: forms out of Markdown, link colours from the company, clickable
links in prose, HTML tables and SVG drawings, the watermark, and the further
changes of 1.0.1 and 1.0.2 in the CHANGELOG.

npm test: 1232 of 1232 checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 12:14:55 +01:00

27 lines
1.2 KiB
Lua

-- Copyright (c) 2026 Marc Wäckerlin. SPDX-License-Identifier: MIT
-- HTML structures that GitHub renders and the LaTeX writer otherwise drops.
-- A raw HTML table remains one table in the Markdown source, including merged
-- cells. Reading that block as HTML gives pandoc a native Table with row and
-- column spans, which every output writer can then render.
function RawBlock(block)
if block.format ~= 'html' or not block.text:match('^%s*<table[%s>]') then
return nil
end
-- The reader runs in an empty sandbox: an `<iframe>` or a picture in the
-- table would otherwise make the build open its address and paste what came
-- back into the PDF.
return pandoc.read(block.text, 'html', nil, {}).blocks
end
-- An empty anchor inside a Markdown table is a stable destination in the web
-- rendering. In LaTeX raw HTML is omitted, so turn it into the equivalent
-- native Span and let pandoc write the label.
function RawInline(inline)
if inline.format ~= 'html' then return nil end
local id = inline.text:match('^%s*<a%s+id=["\']([^"\']+)["\']%s*>%s*$')
if id then return pandoc.Span({}, pandoc.Attr(id)) end
if inline.text:match('^%s*</a>%s*$') then return {} end
return nil
end