CKEditor enforces non-breaking space after footnotes #10261
Replies: 5 comments
|
Hi @Openstreetmapler! I'm Dosu and I’m helping the Trilium team. This behavior is caused by CKEditor's core widget handling, not by Trilium or its footnotes plugin. CKEditor often inserts a non-breaking space ( To reply, just mention @dosu. Docs are dead. Just use Dosu. |
|
@dosubot Thanks for the explanation, but this makes me curious: Why exactly would a regular space after a CKEditor widget cause a trapped cursor? |
|
CKEditor widgets like footnotes are often non-editable spans, and the editor's selection logic can struggle to place the caret (cursor) right after them—especially if the next character is just a regular space. In these cases, the editor sometimes can't reliably determine a valid caret position, which can cause the cursor to get "trapped" inside or immediately after the widget, or even jump to the end of the document when navigating with arrow keys. To work around this, CKEditor inserts a non-breaking space ( To reply, just mention @dosu. Docs are dead. Just use Dosu. |
|
@dosubot Thanks for the explanation! Now I’m satisfied. However, I’m not quite sure whether I should close the issue. |
|
Since this is a CKEditor quirk and not something Trilium can fix directly, it's totally fine to close the issue if you're satisfied and don't expect further action from Trilium maintainers. If you want to keep it open for visibility or to track any upstream changes, that's also valid—sometimes projects leave such issues open as "known upstream limitations." If you ever want to reference or track the upstream CKEditor issue, I can help you find the right link. To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description
In text notes, when I insert a footnote that is followed by a space (like[1] this), the space after the footnote is enforced to be a non-breaking space (
), even if I type a regular space in its place repeatedly. This can be confirmed with the dev tools.This issue is annoying because these spaces prevent line breaks where there is clearly no reason to prevent them:
The HTML inside the box roughly looks like this (note the
):A non-ideal makeshift fix is to have two spaces after each footnote (yuck!) or to use a zero-width space followed by a regular space (tedious!).
TriliumNext Version
0.97.1
What operating system are you using?
macOS
What is your setup?
Local (no sync)
Operating System Version
macOS Monterey 12.7.5
Error logs
No response
All reactions