typora-issues icon indicating copy to clipboard operation
typora-issues copied to clipboard

Wrong indentation in code block in blockquotes

Open aixcyi opened this issue 1 year ago • 1 comments

I write a code block in a blockquote like this:

> See [**PEP 695**](https://docs.python.org/zh-cn/3/whatsnew/3.12.html#pep-695-type-parameter-syntax).
> 
> ```python
> def max[T](args: Iterable[T]) -> T:
>     ...
> 
> class list[T]:
> 
>     def __getitem__(self, index: int, /) -> T:
>         ...
> 
>     def append(self, element: T) -> None:
>         ...
> ```

The code block GitHub rendered like this:

See PEP 695.

def max[T](args: Iterable[T]) -> T:
    ...

class list[T]:

    def __getitem__(self, index: int, /) -> T:
        ...

    def append(self, element: T) -> None:
        ...

but I got different rendered result in Typora:

def max[T](args: Iterable[T]) -> T:
 ...

class list[T]:

 def __getitem__(self, index: int, /) -> T:
     ...

 def append(self, element: T) -> None:
     ...

To Reproduce Steps to reproduce the behavior:

  1. Copy the above markdown code into Typora at source code mode.
  2. Exit source code mode.

Screenshots / Screencasts 图片

Desktop

  • OS: Windows 11 64bit

Typora Version 1.8.10 for Windows (x64)

Additional context I have never tried this before, so I don't know if it can be reproduced with older versions.

aixcyi avatar Feb 19 '24 07:02 aixcyi

I am facing the same problem. When I use Typora to take notes, I can ensure that the indentation of the code I copy is normal. But after a period of time, some of the indentation in the code was magically modified. But I am currently unable to confirm what operation caused the change in code indentation.

HoeYeungHo avatar Apr 03 '24 08:04 HoeYeungHo