// Zeichen im Text der Website (ADR-69): Symbol vor einem Absatz, Nummern im Kreis, Symbol statt Aufzählungspunkt. // Der Editor führt nur Schlüssel als Attribute der Knoten: data-symbol am Absatz; data-marker, data-symbol und data-tone an // Aufzählung und Nummerierung. Bilder und Farben setzt erst die Ausgabe der Website ein. // Gegenstück: App\Filament\Support\TipTap\TextMarksExtension (PHP-Modell beim Speichern). Filament lädt diese Datei als // Erweiterung (RichContentPlugin::getTipTapJsExtensions) und stellt TipTap über window.FilamentRichEditor bereit. const { Extension } = window.FilamentRichEditor.tiptap.core const attribute = (name) => ({ default: null, parseHTML: (element) => element.getAttribute(name), renderHTML: (attributes) => (attributes[name] ? { [name]: attributes[name] } : {}), }) export default Extension.create({ name: 'textMarks', addGlobalAttributes() { return [ { types: ['paragraph'], attributes: { 'data-symbol': attribute('data-symbol') } }, { types: ['bulletList', 'orderedList'], attributes: { 'data-marker': attribute('data-marker'), 'data-symbol': attribute('data-symbol'), 'data-tone': attribute('data-tone'), }, }, ] }, })