Skip to content

Conversation

codebykat
Copy link
Contributor

Fix

A tab (four spaces) at the beginning of a paragraph is parsed as a code block. This is an issue that other Markdown text editors have encountered (Obsidian, for example, has many complaints, e.g. #).

Naturally showdown does not have an option to disable these style codeblocks, despite the fact that we also have Github-style "code fence" support (three backticks). As others have done, I experimented with a naive regex replace that removes four spaces at the beginning of a line and uses three instead, but there are a lot of edge cases with list indentation that probably aren't handled. I also experimented with adjusting the editor's options around tab sizes, but due to the auto detect (and the fact that we're probably going to get four-space-indentations from clients or from existing saved notes) this seems like a nonstarter.

I think if we cleaned up this regex to catch more of the edge cases, it might be a good idea to add this.

Test

Release

Don't render indented paragraphs as code blocks

@codebykat codebykat self-assigned this Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant