Skip to content

Empty code block breaks loading the file #3739

@max-nextcloud

Description

@max-nextcloud

Describe the bug
When a .md file contains a code block that is empty but for one line it will have a loading spinner that spins forever.

To Reproduce
Steps to reproduce the behavior:

  1. Upload attached file to Nextcloud 25 instance
  2. Open the file
  3. See the error in the console and infinite spinning wheel.

Expected behavior
Files with empty code blocks should load just fine.

Server details Seen on cloud.nextcloud.com
Logs

Browser log

Uncaught (in promise) RangeError: Empty text nodes are not allowed
    M index.js:1533
    text index.js:2415
    getContent CodeBlock.js:12
    addElementByRule index.js:2894
    addElement index.js:2831
    addDOM index.js:2754
    addAll index.js:2919
    addElementByRule index.js:2905
    addElement index.js:2831
    addDOM index.js:2754
    addAll index.js:2919
    addElementByRule index.js:2905
    addElement index.js:2831
    addDOM index.js:2754
    addAll index.js:2919
    parse index.js:2518
    be tiptap-core.esm.js:1605
    Ce tiptap-core.esm.js:1951
    createView tiptap-core.esm.js:3490
    Xe tiptap-core.esm.js:3337
    jn EditorFactory.js:141
    onLoaded Editor.vue:512
    promise callback*onLoaded Editor.vue:511
    emit mitt.mjs:1
    emit mitt.mjs:1
    value SyncService.js:308
    t SyncService.js:98
    c SyncService.js:2
    _invoke SyncService.js:2
    v SyncService.js:2
    It SyncService.js:2
    a SyncService.js:2
    promise callback*It SyncService.js:2
    a SyncService.js:2
    Rt SyncService.js:2
    i SyncService.js:2
    value SyncService.js:103
    initSession Editor.vue:373
    mounted Editor.vue:318

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions