What is "docId" in MarkdownPostProcessorContext

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.

1 Like

I would also like to know this. If you registerMarkdownCodeBlockProcessor and that code block exists in a Canvas note, you get a docId, but that docId doesn’t relate to the id of the node.

I’m not sure, but according to this discord message:

docId is a temporary string assigned to a markdown leaf. It remains unchanged even if you navigate to another file in the same leaf. Different leaves opening the same file have different docId . So actually I think you want to use docId + sourcePath instead of docId as the key instead.