Skip to content

WYSIWYG plaintext and rich text fields - #5574

Open
boutell wants to merge 5 commits into
mainfrom
rich-text-fields-plus
Open

WYSIWYG plaintext and rich text fields#5574
boutell wants to merge 5 commits into
mainfrom
rich-text-fields-plus

Conversation

@boutell

@boutell boutell commented Aug 31, 2026

Copy link
Copy Markdown
Member

No description provided.

@boutell
boutell requested a review from BoDonkey August 31, 2026 20:50
"@apostrophecms/apostrophe-astro": minor
---

Added the `AposField` component, which displays one schema field of a document, widget, array item or object and lets the user edit it right where it appears on the page, the way `AposArea` does for areas:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supports astro, nunjucks, and JSX.

const result = await apos.modules['jsx-field-test']
.render(req, 'with-field-inline', { piece: fieldPiece() });
assert.match(result, /Tom & <script>/);
assert.doesNotMatch(result, /<script>/);

`tag` overrides the tag the field type chose, `class` is added to the classes it asks for rather than replacing them, `style` and `attrs` are passed through, `edit={false}` never offers editing, and any other prop reaches the editor as its options.

Apostrophe only sends the information for fields that ask for it, with `wysiwyg: true` on the field or the `wysiwygFields` option of the module, since it cannot tell from the data which fields a template renders in place. While developing, `AposField` writes a note to the terminal when it displays a field that did not ask, naming the field and the option to set. A field that was not annotated is still displayed, just not editable, so a page never breaks over it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both are supported because patching one property of an inherited field is currently awkward.

"apostrophe": patch
---

Rich text permalinks are now substituted as quoted `href` attributes. `linkPermalinks` had been dropping both quotes since permalinks were introduced, emitting `<a href=/contact>` rather than `<a href="/contact">`. Browsers tolerate an unquoted attribute value, so the markup usually behaved, but a URL containing a space became two attributes. This affects rich text everywhere, both widgets and `richText` schema fields, since both share `linkPermalinks`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny little ancient bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants