Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25404

Polish code block integration in BlockNote

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 18.9.0
    • 18.9.0-rc-1
    • BlockNote
    • None
    • Integration
    • Unknown
    • N/A
    • N/A

    Description

      The following problems were found with the BlockNote code blocks while documenting XWIKI-25210:

      • Typing ``` followed by a space creates a code block with an empty language: the language selector shows no value and the code block is saved as {{code language=""}}. Typing ```python followed by a space, or inserting the code block from the slash menu, works fine.
      • The "Code Block" entry of the slash menu displays the CTRL-ALT-C shortcut, but pressing it has no effect.
      • Typing letters while the language selector of a code block has the keyboard focus triggers the XWiki keyboard shortcuts (it opened the class editor in my test), instead of selecting the matching language.
      • In the in-place edit mode, on a page with little content, the slash menu opens above the caret and is clipped, showing only part of its first entry.
      • The language selector uses the language ids of the BlockNote syntax highlighter (Shiki), which are saved as they are in the language parameter of the code macro. Some of them may not be recognized by the code macro (Pygments) in view mode, e.g. "Shell" is saved as language="shellscript". Not verified yet.

      PS: This post was co-written with Claude Code.

      Attachments

        1. slash-menu-after.png
          128 kB
          Marius Dumitru Florea
        2. slash-menu-before.png
          99 kB
          Marius Dumitru Florea

        Issue Links

          Activity

            People

              mflorea Marius Dumitru Florea
              mflorea Marius Dumitru Florea
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: