Different behaviors of MarkdownCodeBlockProcessor under editing/reading modes

I use a parser from an external lib and pass the source string of a code block processor to the parser.

Under editing mode (live preview), it can be correctly parsed, but in the reading mode, it can’t. Seems like a ‘\n’ will be appended to the line/row only in the reading mode.

Just a reminder for whom are also developing plugins related to the code blocks.

Should it be considered a bug? Though we can avoid the problem by splitting the string, the consistent of the view modes is important.