Verbatim-safe typography, ^-punctuation quoting, full-range ^UUUU^, polyglot html

Typographic transforms (---, quote pairs, ~) no longer touch verbatim
text: @c/@code/@source_listing content and ^'...'^ spans show exactly the
characters written. "^" before any punctuation character quotes it in
every target (the apostrophe excepted: ^' opens a literal span), with the
new :resolve option on @@@target declaring per-target renderings. The
^UUUU^ code-point form accepts 4-6 hex digits, the full Unicode range.
The html output and transform spellings are polyglot (XML-valid), in
preparation for an EPUB target. New suites: transform_test, character_test
(engine), typography_test (SKS).

(from dev 07ce5ea86a0a)
This commit is contained in:
2026-08-23 20:48:26 +02:00
parent d982c0d6cc
commit 37b6ba1c4f
77 changed files with 1665 additions and 1608 deletions

View File

@@ -9,7 +9,16 @@ using namespace std::string_literals;
fs::path construct_command_pathname(char* command)
{
return fs::path(fs::current_path().string() + "/" + std::string(command));
// The pseudo source file for command-line string input (-s, kdiag's
// input): a file IN THE CWD named after the command, so that a relative
// @read in string input resolves against the directory the user ran the
// command from -- the string-input analog of "a document's relative
// names resolve against the document". The basename matters: the
// former "<cwd>/<argv[0]>" string concatenation anchored resolution at
// the BINARY's directory whenever argv[0] was absolute
// (/usr/local/bin/ktext, a wrapper script), so every relative @read in
// -s input searched bin/ instead of the cwd.
return fs::current_path() / fs::path(command).filename();
}
void set_verbose_level(int argc, char* argv[])
@@ -124,7 +133,7 @@ void load_klammersets(Machine& machine, const strings_t& symbols)
"The klammerset \"none\" cannot be combined with other klammersets: "
"it means that none is loaded. Give \"none\" alone, or name only the "
"klammersets to load.",
Locator());
Locator::none());
}
if (symbols.empty()) {
// Which klammerset was loaded, and from where, is a DERIVED value: the
@@ -146,7 +155,7 @@ void load_klammersets(Machine& machine, const strings_t& symbols)
continue;
}
std::string klammerset_filename = resolve_klammerset_symbol(
symbol, machine.m_state.value("K_input_dir"), Locator()).string();
symbol, machine.m_state.value("K_input_dir"), Locator::none()).string();
// Symbol -> file is the search path's answer, and the search
// path has three stages with shadowing: the file it landed on is
// exactly what a user cannot read off "--klammersets x".