Skip to content

Code snippets not properly indented if included in numbered lists w/o empty newline #2057

Closed
@adamlui

Description

@adamlui

Bug Report

When code snippets are included in numbered lists without an empty newline separating numbered heading & snippet, indents become single spaces:

image

Steps to reproduce

In the doc, write a code snippet after numbered item without using an empty newline:

4. In scripts that use `chatgpt.js` (foreground or background), structure like so:
```js
(async () => {
    const { chatgpt } = await import(chrome.runtime.getURL('lib/chatgpt.js'));    
    // Your code here...
})();
```

What is current behaviour

4-space indents in code block become 1-space

What is the expected behaviour

4-space indents remain 4-space

Other relevant information

The bug is live @ https://chatgpt.js.org

While inserting an empty newline between the numbered item & the code block restores proper indentation, it strangely removes the vertical gap between the two when rendered, so omitting empty newline is less unpleasing aesthetically (relative to whole site vs. merely code blocks being off)

  • Bug does still occur when all/other plugins are disabled?

  • Your OS: Windows 10

  • Node.js version: 18.15.0

  • npm/yarn version: 9.5.0

  • Browser version: Firefox 111.0

  • Docsify version: 4.13.0

  • Docsify plugins:

Please create a reproducible sandbox

The codesandbox.io site keeps giving error when I try to upload files (https://github.com/chatgptjs/chatgpt.js/tree/main/docs)

Edit 307qqv236

Mention the docsify version in which this bug was not present (if any)

Metadata

Metadata

Assignees

No one assigned

    Labels

    attentiondependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions