MMMarkdown
MMMarkdown copied to clipboard
Request: ability to turn off Setext-style headers and non-fenced code blocks
Hi,
Would you be open having two options added to MMarkdownExtensions
:
-
MMMarkdownExtensionsNoSetextHeaders
: Disable detection of headers like
A Setext Header
=============
and instead only allow the
# Atx Style Headers
-
MMMarkdownExtensionsNoSpaceIndentedCodeBlocks
: Disable detection of code blocks preceded by four spaces as in:
This would no longer be a code block.
and instead allow fenced code blocks (if MMMarkdownExtensionsFencedCodeBlocks is enabled).
I ask because I'm making a user-facing Markdown app and I want to avoid confusion amongst my users about whether to use the #
(Atx) or ===
(Setext) headers. I also want to avoid confusion about space-indented code blocks.
Also, turning off Setext headers and space-indented code blocks makes Markdown syntax highlighting within the markdown input editor much easier.
I think this would be two simple changes in MMMarkdown.h
and MMParser.m
.
If I was willing to make these code changes, including automated tests, on a fork, would you be open to a pull request to merge this into the master branch? :-)
I'm really enjoying MMMarkdown (thanks!) and I need these two new flags but I'd rather avoid forking and diverging my own version from your master since that will make subsequent updates to your later releases more difficult and require git merges, etc.
In my experience, use of Setext headers is rare since they only have 2 levels of headers (compared to 6 for Atx). Also, fenced code blocks seem far more popular than space-indented ones in my experience.
Thanks and best wishes.
I'm going to take a couple days to think about it, but I think I'm probably okay with doing this.
Awesome, thanks! :-)
I'm okay with this approach if you want to open a PR. :relaxed:
Thanks! Will do.