feat(editor): preserve arbitrary font sizes and families in content#12984
feat(editor): preserve arbitrary font sizes and families in content#12984dagyu wants to merge 1 commit into
Conversation
|
Thanks for the changes
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 I update the commit footer as written in 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.movNEW.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
left a comment
There was a problem hiding this comment.
tested and it works, thanks a lot
|
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 |
|
Hello there, 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.) |
|
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 :) |
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.colorsurvives;font-sizeandfont-familyare dropped. There is no way towork around it from the signature HTML — the loss happens inside the editor.
Root cause
The composer's CKEditor
FontSize/FontFamilyplugins run with theirdefault presets and
supportAllValuesdisabled. When signature/pasted HTML isinserted into the editor, any
font-sizeorfont-familythat isn't one ofthe built-in presets is stripped during the model round-trip. (
coloris keptbecause
FontColoraccepts all values by default — which is exactly thebehaviour size/family should have too.)
Fix
Enable
supportAllValues: trueon both Font plugins so inlinefont-sizeandfont-familysurvive: