Test un-annotated code blocks when using Not#65
Conversation
|
Hey 👋 Thanks for using Unless there is a specific motivation for this change, I'm not going to merge this at this point. |
|
Hey! So my motivation is that I'd like to contribute a configuration mode where I could use plain indented code blocks as Haskell code. This PR was my first step towards clarifying my understanding of the semantics of the class flag. Do you think that use case make sense, and is it something you'd be willing to merge? It's fine if you don't think this is mergeable, and I don't want to open nuisance PRs in the future. |
If feasible without implementing a full markdown parser, and if it doesn't get too messy, then technically it's within the scope of the project. Indented code blocks have to be proceeded by an empty line (or be at the beginning of the document) and be indented by four spaces. However, this alone is not enough to decide what to extract. For example: - foo
barHere
but it is part of the list item, not an indented code block. |
|
Yep, the existing test for delimited code blocks indented under a list item made that clear 🙂 I'm sure it will be a pain if possible at all. Why not go for a full markdown parser by the way? |
|
I was about to say:
But then I realized that I actually did this in the past: https://hackage.haskell.org/package/pandoc-unlit I'm not sure if it still compiles, but you could use it as a starting point for a new package, e.g. |
Adds a minor test case that a non-annotated code block matches
Not foo.