Skip to content

[Plugin API] 3 bugs of block insertion API (both methods) #10729

@stdword

Description

@stdword

Search first

  • I searched and no similar issues were found

What Happened?

1) .insertBlock continues numbering, when no such property was provided:

2) .insertBatchBlock ignores empty blocks:

3) .insertBatchBlock cannot handle before: true:

Reproduce the Bug

1) steps:

  1. Create block
  2. Add numbering to it (t n)
  3. Insert block under it as a sibling via API call .insertBlock with options {sibling: true}

2) steps:

  1. Create empty block
  2. Create non-empty child block
  3. Insert block under the parent via API call .insertBatchBlock with options {before: false, sibling: true}
  4. Call the same API method second time ← bug is here
  5. NOTE: the bug reproduces, but not every time: can't find the exact reason

3) steps:

  1. Create block
  2. Insert block before it via API call .insertBatchBlock with options {before: true, sibling: true}

Expected Behavior

  1. No numbering via API insertion — only in manual mode.

  2. and 3) obvious work of API method

Desktop or Mobile Platform Information

MacOS v13.4
Logseq Desktop v0.10.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions