laurent22 / joplin

Joplin - the secure note taking and to-do app with synchronisation capabilities for Windows, macOS, Linux, Android and iOS.
https://joplinapp.org
Other
44.2k stars 4.78k forks source link

Desktop: Space characters before backticks should use a monospaced font #6638

Open KaneGreen opened 2 years ago

KaneGreen commented 2 years ago

Environment

Joplin version: Joplin 2.8.8 (prod, win32) Platform: Windows (But I think this problem may be related to all platforms) OS specifics: Windows 10 64bit 21H2 (19044.1806)

Steps to reproduce

Consider the following Markdown:

* hello world
    ```python
    print("Hello, world")
Please note: lines 2~4, there are four spaces before ```` ``` ```` and `print`.

On the left half of Joplin's CodeMirror it is rendered like this:
![image](https://user-images.githubusercontent.com/20700283/177085386-0d58f5e2-4861-4c61-ac71-ddc99224b9b6.png)
Apparently, the space at the beginning of the second line is not using a monospaced font.
![image](https://user-images.githubusercontent.com/20700283/177086044-7b19ec1b-3bd8-4188-8c13-6fa14ada2abc.png)
The developer tools also state this. 

## Describe what you expected to happen
I think, the first ` &nbsp; &nbsp;` should also be wrapped inside `<span class="cm-null cm-jn-monospace"></span>`.
Visually, the four spaces should use the same monospaced font.

## HTML in Developer tools
personalizedrefrigerator commented 5 months ago

This seems to be fixed in the beta CodeMirror 6 editor, but still an issue in the CodeMirror 5 editor: screenshot: CodeMirror 6 monospaces text before codeblocks