Skip to content

Bugs with new mathematics node types #7977

Description

@mejo-

Describe the bug

Follow-up issue for #7957.

  • Inline formulas enforce a newline at their end, which is unexpected for inline nodes.
  • When inserting an inline formula at the end of the document, it seems impossible to position the cursor after the node, so impossible to insert content behind it.
  • When inserting a block type formula and placing the cursor in the next line, typing will remove the added formula.
  • In menubar, "Display formula" seems a bit unclear to me as node type. Maybe "block math formula" or just "block math" would be better? Similarly, "inline formula" could be changed to "inline math formula" or just "inline math".
  • In menubar, "Inline formula" is placed in the block node submenu, next to blockquotes, codeblocks and callouts. I would not expect it there. Not sure though what would be the best alternative place 🤔
  • Probably we should use and expand https://tiptap.dev/docs/editor/extensions/nodes/mathematics instead of re-implementing it all ourselves.
  • Simple playwright tests to add both node types would be great.

Activity

  1. moodyjmz commented on Nov 24, 2025

    @moodyjmz
    Contributor

    I think some of these bugs might be addressed by using the tiptap mathematics extension

  2. moodyjmz commented on Nov 24, 2025

    @moodyjmz
    Contributor

    I think changing the menu names first and deciding where the feature lives is one step.

    Migrating over to the tiptap extension is another.

  3. moodyjmz commented on Nov 24, 2025

    @moodyjmz
    Contributor

    @mejo- Do we need to consider backward compat?

    It looks like tiptap just needs div[data-type="block-math"] to be picked up (and inline too) without content matching etc

    So we can do:

             parseHTML() {                                                                                                     │
                  return [                                                                                                        │
                  // Standard Tiptap format                                                                                     │
                  { tag: 'div[data-type="block-math"]' },
    }

    Otherwise, we need to pick up the katex block as well

  4. mejo- commented on Nov 24, 2025

    @mejo-
    MemberAuthor

    @mejo- Do we need to consider backward compat?

    Sorry I totally forgot to comment on that. Nope, we don't. So far, the feature is only merged into the development branch of Text (main) and no new major release got branched off from there yet. The release of Nextcloud 33 (next major release) is scheduled for 2026-02-18. Before this date, there's no need to consider backwards (in)compatibility.

  5. moodyjmz commented on Nov 24, 2025

    @moodyjmz
    Contributor

    @mejo- awesome!

  6. moodyjmz commented on Nov 24, 2025

    @moodyjmz
    Contributor

    I think I would change to use tiptap, then leave the renaming for another PR - I imagine where it sits in menus involved more people. @mejo-

  7. mejo- commented on Nov 24, 2025

    @mejo-
    MemberAuthor

    I think I would change to use tiptap, then leave the renaming for another PR - I imagine where it sits in menus involved more people. @mejo-

    Perfect, thanks @moodyjmz! I think you could rename the menubar entries in your new PR already as I consider this uncontroversial. But I'm also fine with leaving this for later. As you wish. Moving the inline node entry somewhere else can happen later on in another follow-up after we discussed it with the design team.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    1. to developbugSomething isn't workingfeature: formattingFeatures related to text formatting and node types

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions