fix: Allow for pandoc style codefences#2468
fix: Allow for pandoc style codefences#2468dmadisetti wants to merge 3 commits intofacelessuser:mainfrom
Conversation
Unfortunately, I cannot accept this PR. |
|
Maybe a bad example. The behavior between this pr and the current case is the same for ```{.haskell} {.numberLines}
qsort [] = []
```since attributes match is greedy This might break fewer cases than you think, just allows different ordering for attributes |
I'm not sure how that addresses my three statements. Using the case I showed does not add any of these attributes. In addition to my three earlier statements, it appears this has not yet been tested as it:
|
I understand that there does not have to be parity, but it can't hurt (: |
|
I am actually phasing out that old style of testing. SuperFence tests should go here: https://github.com/facelessuser/pymdown-extensions/blob/main/tests/test_extensions/test_superfences.py. This doesn't mean I've decided to add this functionality, but I will at least consider it if you move the tests and ensure it is all working. Please make sure you've considered edge cases. I'll think about this and give a response once I've decided. |
| if m is not None: | ||
|
|
||
| # Parse options | ||
| self.lang = m.group('lang') or '' |
There was a problem hiding this comment.
I understand this was moved out to be in one place, but I would prefer that the language handling is parsed in the handle_attrs and parse_options functions.
|
I do think I'm okay with the idea. It seems like the changes will be minimal.
|
Based off of @dmadisetti's code in PR #2468
|
Hey, @dmadisetti as I've warmed up to this idea, I was digging in and decided to clean up the regex and such, so I've issued a new PR that cleans up my requests and references you and this PR. That PR will supersede this one. I think when it became apparent that we could do this with very little impact, it kind of became hard to argue against this. Admittedly, I think many will find this new format preferable. Thanks for getting this rolling and pushing for it, I do think it'll be a good addition. |
|
Much appreciated! Looking forward to the update |
Support alternate fenced header form Based off of @dmadisetti's code in PR #2468
Great extension! Love its ubiquity. Noticed that the codefence logic does not match something like:
(see https://regex101.com/r/luUSyy/1)
Which is acceptable and expected in pandoc: https://pandoc.org/chunkedhtml-demo/8.5-verbatim-code-blocks.html#extension-fenced_code_attributes
+fixes this and allows for a bit more flexibility in the attribute ordering: https://regex101.com/r/jEZuZ7/1