obsidian-linter icon indicating copy to clipboard operation
obsidian-linter copied to clipboard

FR: Handle Adding `>` to Math Blocks Lines in a Callouts/Bloquotes when the Opening Line Does Have It

Open math-feng opened this issue 1 year ago • 4 comments

  • [x] I have verified that I am on the latest version of the Linter

Describe the Bug

in callout like $$\n (content) \n $$ that triggers a command with one and only one line before and after the paragraph

How to Reproduce

  1. turn on paragraph line break options。

  2. Example to reproduce issue with

> [!theorem|*] Argument principle
> Suppose f is a meromorphic function on an open set containing a circle $C$ and it's interior. If $f$ has no poles and never vanishing on $C$, then 
> $$
\frac{1}{2\pi i}\int_{C} \frac{f'(z)}{f(z)}dz=
>$$
>(number of zores of $f$ inside $C$ ) mimus (number of poles of $f$ inside C).
  1. ctrl+s

math-feng avatar Feb 23 '24 12:02 math-feng

Hey @math-feng . Could you provide the expected output?

I am seeing a potential problem with the formatting. The parser the Linter uses expects math blocks in a blockquote to have the blockquote indicator at the start of the line. So your blockquote should look like so:

> [!theorem|*] Argument principle
> Suppose f is a meromorphic function on an open set containing a circle $C$ and it's interior. If $f$ has no poles and never vanishing on $C$, then 
> $$
> \frac{1}{2\pi i}\int_{C} \frac{f'(z)}{f(z)}dz=
> $$
>(number of zores of $f$ inside $C$ ) mimus (number of poles of $f$ inside C).

pjkaufman avatar Feb 28 '24 21:02 pjkaufman

It looks like if I use the format above, there is no issue with the math block. So I want to say this is not an issue in the Linter. Please feel free to give feedback on this though.

pjkaufman avatar Feb 28 '24 21:02 pjkaufman

It is true that following the format you provided does not produce the error anymore. But could you please add a function: in callout $$... $$ includes math expressions with the symbol ">" at the beginning of the line.

math-feng avatar Mar 02 '24 12:03 math-feng

I am not sure that I can. The parser does not consider that content to be a part of the blockquote and it is not considered to be a part of the math block. So I am not entirely sure how fixing it would work in this case as most operations operate on the parser's results and math blocks are allowed to have $ indicators in them. I don't know that I know enough about the math block format to properly fix this scenario. I wilk think about more on this, but I am open to ideas on how to make thos work in the meantime.

I have only seen one other reported instance of this #1013 .

pjkaufman avatar Mar 02 '24 13:03 pjkaufman