Comment (`%%`) semantics

There has been discussion in the past about a specification for Obsidian flavoured markdown, with the answer on the linked post mentioning that Obsidian only has a few additions from Commonmark, however the semantics of these additions are in some cases quite unclear.

It seems like comments are neither inline nor block elements given the way they can sit within text, but have new lines within them, such as below:

some text %% with
a comment

spanning multiple lines %% and some text after

However in cases like this one, the comment is not stripped out, yet the closing (but not the opening) comment delimiter is not displayed:

# title %%
text which is not in the comment
%%

While putting a code block within a comment causes the code block to still be rendered, along with the other text, but the quote delimiters to be removed:

%% here is a comment with a code block
```
some code
```
%%

I was wondering if these strange cases could be treated as bugs, or we could get some kind of specification or open sourcing of the parser so that it would be clear how comments actually work.

yes, it’s a big mess. We’ll see if we can clear it up sometimes.

3 Likes

Do you have any rough indication for the planned semantics once cleared up, or which of the my examples are considered bugs? I don’t want to be using comments in a way that will break upon an update.