docs: document block-level custom formats and image captions for WYSIWYG - #801
Open
alvarosabu wants to merge 1 commit into
Open
docs: document block-level custom formats and image captions for WYSIWYG#801alvarosabu wants to merge 1 commit into
alvarosabu wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents the two user-facing additions in directus/directus#28044: block-level custom formats and image captions in the Tiptap-based WYSIWYG interface.
Summary
guides/data-model/rich-text("Rich Text", between Interfaces and Relationships). Covers the Custom Formats option in full, the gotchas, toggling semantics,<figure>caption output, and how to style the stored HTML on a frontend.guides/data-model/interfaces. The Custom Formats row read "Only inline formats are supported; block, selector, and wrapper formats are ignored", which #28044 makes false. Rewritten, plus a link callout to the new page.4.relationships.md→5.relationships.mdto open the slot. Prefix-only change, so the URL is unchanged.Why a new page
WYSIWYG had one options table row and no page of its own. Nothing in
/contentcovered consuming or styling rich text output, which is where most of this material belongs. The largest topic here (classes have no styling inside the editor) had no existing home, and the most detailed WYSIWYG prose in the repo was a v12 breaking-changes notice that stops being the right shelf as soon as v13 ships.What the page documents
Custom Formats reference: the four entry keys (
inline,block,selector,items), theclasses/attributesanchor requirement, the list of tags a block format can target, and the eight reasons an entry gets skipped (all of which surface as browser-console warnings, not UI).Three gotchas:
figure { display: table; margin: 0.8125rem auto }case, where afloat-leftfigure renders centered in the editor and floated on the frontend.styleson a block or selector entry only styles the dropdown label.styleis not round-tripped on nodes, which diverges from TinyMCE.attributeson a block entry is filtered to the preserved set;divandspancannot carry a block format, the same root cause as stored<div>wrappers being unwrapped on load.Image captions: the drawer's Caption field, the
<figure>/<figcaption>output shape, when clearing a caption unwraps the figure and when it does not, and the Enter/Backspace behavior inside a caption.Verified against the implementation
Read the source on
feat/tiptap-block-custom-formatsrather than working from the handover notes. Four things the notes did not mention are documented:selectorentry containing one unmodelled tag is skipped entirely, not per-tag (custom-formats.ts:249).attributes(custom-formats.ts:171); only block/selector entries do. The notes described only the block side.buildGroupreturnsnullon zero children).apper: trueis a typo forwrapper(custom-formats.ts:317).Wording is kept consistent with
interfaces.input-rich-text-html.custom_formats_noteinen-US.yaml:2781.Test plan
pnpm buildexits 0 with zero prerender errors/docs/guides/data-model/rich-textprerenders/docs/guides/data-model/relationshipsURL unchanged after the renumberPart of CMS-2921