Toggle comment

Steps to reproduce

  1. Toggle comment on a line with some text with Ctrl + /

Changes:
<some text>

Into:
%% <some text %%

  1. Without doing anything else, toggle comment again with Ctrl + /

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

<some text>

Actual result

<some text>

Note: There is a space character before and after the text.

Environment

SYSTEM INFO:
Obsidian version: v1.8.10
Installer version: v1.5.12
Operating system: Windows 10 Pro 10.0.26100
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

None.

I am not sure I understand your repro steps.

However, you have to be careful writing <some text> because this is interpreted as an html tag.
You should escape it \<some text\>

I can reproduce and I agree that comment untoggle should remove the extra spaces to produce equivalent effect with ⌘Z.

Screenshots with Control Characters community plugin:



(text is selected by default but you can but cursor anywhere between double percent signs)
image

The <some text> was just a placeholder for any text. The <> are not part of the mandatory steps to reproduce.

@blue_emperor thanks for clarifying with screenshots.

I have no rights to edit the original post to fix the steps to reproduce.