The editor breaks the format when pasting text that has code formatting blocks from web sites created with Docusaurus. Instead of the entire block being encapsulated by ``` , there is a closing ``` after the first line and each other line in the code block is prefixed and appended with `. It also puts an empty line in between in line in the code block.
Here’s an example of how a paste looks like of this section: Create a doc | Docusaurus Note how the code blocks are now individual lines instead of a continuous code block. This occurs with any site I’ve tested that’s built with Docusaurus, not just their own site.
Every document has a unique id. By default, a document id is the name of the document (without the extension) relative to the root docs directory.
For example, the ID of greeting.md is greeting, and the ID of guide/hello.md is guide/hello.
website # Root directory of your site
└── docs
├── greeting.md
└── guide
└── hello.md
However, the last part of the id can be defined by the user in the front matter. For example, if guide/hello.md’s content is defined as below, its final id is guide/part1.
---
id: part1
---
Lorem ipsum
The ID is used to refer to a document when hand-writing sidebars, or when using docs-related layout components or hooks.
Can you share an example? I couldn’t reproduce it with some sources I tried.
The issue with the Docusaurus output is that its code block uses one div per line, which wasn’t really expected. I merged a fix today.
Here’s the output of the same copy&pasted selection:
Every document has a unique id. By default, a document id is the name of the document (without the extension) relative to the root docs directory.
For example, the ID of greeting.md is greeting, and the ID of guide/hello.md is guide/hello.
website # Root directory of your site
└── docs
├── greeting.md
└── guide
└── hello.md
However, the last part of the id can be defined by the user in the front matter. For example, if guide/hello.md’s content is defined as below, its final id is guide/part1.
---
id: part1
---
Lorem ipsum
The ID is used to refer to a document when hand-writing sidebars, or when using docs-related layout components or hooks.