vscode-markdown icon indicating copy to clipboard operation
vscode-markdown copied to clipboard

Toggle math bug: Block quote is not respected

Open randallwc opened this issue 3 years ago • 2 comments

Problem

When using the macro ⌘+M for generating

  • $$
  • $$\n\n$$
  • $$ $$

It works unless you are at the end of a blockquote.

How to reproduce

> blockquote
> |

Place your cursor where '|' is in the above code block and press the "⌘+M" macro three times.

From here you can see that the sequence of events is as follows

> blockquote
> $|$
> blockquote
> $$
|
$$

but after you press it again it goes to this

> blockquote
> $$
$|$
$$

Instead of this

> blockquote
> $$ | $$

environment

I am on a mac on macOS Big Sur.

errors in console

[Extension Host] (node:4926) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Extension host terminated unexpectedly. Code:  null  Signal:  SIGABRT
Extension host terminated unexpectedly.

randallwc avatar Mar 04 '21 08:03 randallwc

Thanks.

Please check out the dev build.

yzhang-gh avatar Mar 04 '21 11:03 yzhang-gh

I'm afraid the current solution is somewhat strange. The 2nd step still produces two math blocks, which should be avoided.

<!-- 1 -->

> $$

<!-- 2 -->

> $$

$$

<!-- 3 -->

> $$  $$

I prefer #951. It's safe.

<!-- 1 -->

> $$

<!-- 2 -->

> $$
>
> $$

Lemmingh avatar Oct 19 '21 17:10 Lemmingh