Files
edentext/src/lib/storage/hyphenation.ts
T
Steffen Becker 46fb30249f feat: automatic hyphenation for the whole document
Layout > Hyphenation, off by default as in both word processors. The
browser hyphenates in the document's own language (the body host gets
lang and hyphens: auto) — measured, a justified German paragraph takes
15 lines instead of 17. ODF keeps fo:hyphenate in the base style's TEXT
properties: probed, in paragraph-properties LibreOffice ignores it and
drops it on the next save. Word takes w:autoHyphenation.
2026-08-14 01:02:12 +02:00

18 lines
602 B
TypeScript

// Automatic hyphenation for the whole document: LibreOffice's Format ▸ Paragraph ▸
// Text Flow on the default paragraph style, Word's Layout ▸ Hyphenation. Off in both,
// so off here. ODF carries it as `fo:hyphenate` on that style, Word as
// `w:autoHyphenation` in settings.xml.
const KEY = 'edentext-hyphenation';
export const DEFAULT_HYPHENATION = false;
export function loadHyphenation(): boolean {
return localStorage.getItem(KEY) === 'true';
}
export function saveHyphenation(on: boolean): void {
if (on) localStorage.setItem(KEY, 'true');
else localStorage.removeItem(KEY);
}