Skip to content

feat(editor): preserve arbitrary font sizes and families in content#12984

Open
dagyu wants to merge 1 commit into
nextcloud:mainfrom
dagyu:main
Open

feat(editor): preserve arbitrary font sizes and families in content#12984
dagyu wants to merge 1 commit into
nextcloud:mainfrom
dagyu:main

Conversation

@dagyu

@dagyu dagyu commented May 27, 2026

Copy link
Copy Markdown

Problem — custom HTML signatures don't work

Setting a custom HTML signature (a branded block with specific fonts and
sizes — e.g. a 13pt name, 11pt role/phone, 9pt address, a logo and links) is a
common, reasonable requirement. Today it's effectively impossible to do
faithfully through Mail
: the signature is stored correctly, looks correct in
account settings, but loses its typography the moment it passes through the
composer
, and reaches recipients with the wrong size and font.

Concretely, given a signature span like:

<span style="color:#3c3c3b;font-family:Arial,Helvetica,sans-serif;font-size:13pt">…</span>

the recipient receives:

<span style="color:#3c3c3b">…</span> ← font-size and font-family gone.

color survives; font-size and font-family are dropped. There is no way to
work around it from the signature HTML — the loss happens inside the editor.

Root cause

The composer's CKEditor FontSize / FontFamily plugins run with their
default presets and supportAllValues disabled. When signature/pasted HTML is
inserted into the editor, any font-size or font-family that isn't one of
the built-in presets is stripped during the model round-trip. (color is kept
because FontColor accepts all values by default — which is exactly the
behaviour size/family should have too.)

Fix

Enable supportAllValues: true on both Font plugins so inline font-size and
font-family survive:

fontSize: {
    options: [9, 10, 11, 12, 13, 14, 16, 18, 24, 'default'],
    supportAllValues: true,
},
fontFamily: {
    supportAllValues: true,
},

@ChristophWurst

ChristophWurst commented May 27, 2026

Copy link
Copy Markdown
Member

Thanks for the changes

How can this be tested? The signature editor doesn't allow arbitrary font sizes either, does it?

It would be best if you could provide before and after screenshots that demo the change in addition to textual steps to reproduce.

Please point your agents to AGENTS.md to fix the commit footer.

@ChristophWurst ChristophWurst added feature:editor All bugs, features and pull requests about the (HTML) editor enhancement labels May 27, 2026
@dagyu

dagyu commented May 28, 2026

Copy link
Copy Markdown
Author

@ChristophWurst I update the commit footer as written in AGENTS.md.

Following videos show exactly the bug that I had, without the patch it is impossible for me to customize the font size cause the editor doesn't preserve the values. First video is current main version, second one is the patched version.

OLD.mov
NEW.mov

The rich-text composer's Font plugins (FontSize/FontFamily) run with
their default presets and supportAllValues disabled. As a result any
font-size or font-family that is not one of the built-in presets is
silently dropped when HTML is inserted or pasted into the editor —
most visibly, signatures or pasted content lose their typography on
send.

Enable supportAllValues on both plugins so inline font-size and
font-family survive the editor round-trip. FontSize additionally
requires numeric options when supportAllValues is set (named presets
such as "big"/"huge" are incompatible and throw at init), so the
options list is switched to numeric point/pixel sizes.

Assisted-by: Claude:claude-opus-4-7
Signed-off-by: dagyu <dagyu95dev@gmail.com>

@GretaD GretaD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tested and it works, thanks a lot

@dagyu

dagyu commented Jun 3, 2026

Copy link
Copy Markdown
Author

Can you tell me please if you are planning to put this in the next release? Because I need it so if you can't I will install patched version

@github-actions

Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@GretaD

GretaD commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

hi @dagyu sorry for the late reply. Can you please fix the lint issue so we can merge this? I tried to fix it myself, but i dont have pushing rights here :)

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

Labels

3. to review enhancement feature:editor All bugs, features and pull requests about the (HTML) editor feedback-requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants