Skip to content

First processed codeblock result is hidden on reading mode #6

@Krakor92

Description

@Krakor92
  • The Plugin is up to date (0.3.1)
  • Obsidian and Installer are up to date (1.5.12)

Describe the bug

When a processed codeblock (dataviewjs, js-engine, ...) sits right at the top of a file with no character above it (except newlines), it won't get rendered on reading mode even though the DOM gets populated by whatever the codeblock produces

To Reproduce

  1. Open the Sandbox vault
  2. Install Shiki Highlighter and any other plugin that register a MarkdownPostProcessor (JS Engine for example)
  3. Create a new empty file and paste a simple codeblock that render something
```js-engine
return 1
```
  1. Switch to reading mode

Expected behavior
You can see a 1

Actual behavior
Nothing is visible

Tested on

  • Linux
  • Android
  • iPadOS

Additional context

  • Placing a pair of %% with a character inside, or any other character above the code block, will make it behave as expected.
  • It looks like the culprit code is here. The rule should be more specific

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions