I expect the processor to behave the same in editing and reading mode. Thus the expected result in the developer console should be:
“foo”
“foo”
Actual result
The actual result differs in that an extra new line is passed while the processor is called in reading mode. Developer console:
“foo”
“foo\n”
Environment
SYSTEM INFO:
Obsidian version: v1.7.4
Installer version: v1.4.13
Operating system: #134~20.04.1-Ubuntu SMP Tue Oct 1 15:27:33 UTC 2024 5.15.0-124-generic
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: dark
Community theme: none
Snippets enabled: 1
Restricted mode: off
Plugins installed: 10
Plugins enabled: 1
1: Obsidian TikZ v0.1.0
RECOMMENDATIONS:
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.
I’ve had a bug report for the Tasks plugin that looks like it is caused by this behaviour (different search results in Live Preview than Reading mode):
Is it known which version of Obsidian introduced this behaviour?
My user is speculating the cause may be the following change in 1.7.4
I think perhaps the stable/public release of Obsidian 1.7.4 is the culprit, which includes the Catalyst/preview changes from Obsidian 1.7.2, judging by the changelog entry Live preview now only escapes special characters (not letters and numbers)..
I will look into this. We’ve recently made some changes to fix html entity characters in source code that wasn’t properly decoded, so that’s likely where the bug came from.
Just to note that the title of this issue - extra newline when in reading mode - is different from the actual change in behaviour…
From Tasks bug #3137, the observable change in behaviour is that the newline that used to be present at the end of code blocks in Live Preview is now removed…
I guess it makes sense following the unix convention that a line ends with \n.
Does really matter for me as I now trim whitespace and add a single newline at the end myself.