Can someone explain to me what docId is in the MarkdownPostProcessorContext in the handler of registerMarkdownCodeBlockProcessor. When I log it, and I have different code blocks in one document in editing mode, they return different values for each code block. However, in reading mode, each codeblock returns the same value.
In the context of a Markdown processor,
docId refers to the unique identifier of the document being processed. The
docId is passed as a parameter to the handler function when you register a code block processor using
registerMarkdownCodeBlockProcessor in a Markdown editor.
In editing mode, when you have multiple code blocks within the same document, each code block is considered a separate instance and is assigned a different
docId. This is because the document is still being edited and may undergo changes, such as additions or deletions, resulting in a new
docId being generated for each code block. Therefore, you may observe different
docId values when logging them for different code blocks within the same document in editing mode.
On the other hand, in reading mode, when the document is finalized and considered as a completed version, each code block within the document would likely be associated with the same
docId, as the document is considered stable and unchanging. Therefore, you may observe the same
docId value for all code blocks within the same document in reading mode.
It’s important to note that the exact behavior of
docId may vary depending on the specific implementation of the Markdown processor or editor you are using, so it’s always best to consult the documentation or refer to the source code of the specific Markdown processor or editor to understand its behavior in detail.