apsis-book/frontend
dev ec78ac009b Let a formula be copied as the formula
Copying a formula from a page gave one character per line: the SGP4 a_1
block arrived as a hundred and thirty-two lines for a hundred and
thirty-two characters. That is how a browser copies MathML, which is one
element per token and is walked one element at a time.

The rendering was not the fault. The block was measured in place and the
six rows each hold their two cells side by side, with the tokens of a row
sharing a baseline, and a screenshot agrees. What was wrong is what a
reader gets when they take the formula away.

The source is therefore carried beside the MathML in an element that can
be selected, and the MathML is taken out of selection. A copy now yields
the notation the formula was written in, on one line, which is what a
reader can paste into a tool that understands it.

The source is trimmed when it is rendered, because the delimiters of a
display formula sit on their own lines and the newline after the opening
pair was arriving as a leading space.
2026-10-02 12:06:11 +08:00
..
src Let a formula be copied as the formula 2026-10-02 12:06:11 +08:00
index.html web: add the apsis-web service, content, and frontend 2026-09-27 00:53:20 +08:00
package-lock.json web: add the apsis-web service, content, and frontend 2026-09-27 00:53:20 +08:00
package.json web: add the apsis-web service, content, and frontend 2026-09-27 00:53:20 +08:00
svelte.config.js web: add the apsis-web service, content, and frontend 2026-09-27 00:53:20 +08:00
tsconfig.json web: add the apsis-web service, content, and frontend 2026-09-27 00:53:20 +08:00
vite.config.ts web: name assets with a content hash so a stale bundle cannot be served 2026-10-01 09:06:10 +08:00