Conversation
Codecov Report
@@ Coverage Diff @@
## master #8 +/- ##
=========================================
Coverage ? 92.85%
=========================================
Files ? 3
Lines ? 168
Branches ? 0
=========================================
Hits ? 156
Misses ? 12
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
|
@chrisjsewell I'd like to review before merging please. Also, I actually prefer the original configuration and Poetry in projects that have dependencies. |
|
Regarding the repo transfer, my thinking was that it happened on similar terms as mdformat. |
hukkin
left a comment
There was a problem hiding this comment.
Added a few notes.
Also, there was an undocumented bug where the first line is too wide when --wrap=INTEGER is used. That's why I originally didn't indent the text. This change applies the problem to all lines, which I'm fine with if it fixes a bug, but we should make an issue about that.
| body = indent("\n\n".join(elements), " " * 4) | ||
| # if the first body element is a paragraph, we can start on the first line, | ||
| # otherwise we start on the second line | ||
| if body and node.children and node.children[0].type != "paragraph": |
There was a problem hiding this comment.
the body condition makes me think, what happens if not body. If that is valid syntax, I think it needs separate handling where no trailing space is added?
There was a problem hiding this comment.
yes it is valid syntax, but yeh I can remove the trailing space. In fact it was removing it, but then I refactored the code slightly and forgot to "rehandle" it
There was a problem hiding this comment.
actually it only works currently if there is a space, otherwise it is not recognized as a footnote.
I note though, that this is recognized as a footnote in VS Code previews (which uses markdown-it), so perhaps this is a bug in the plugin (albeit a quite unlikely scenario, that you would want a footnote with no text)
|
Absolutely happy to wait for your review, but err I would say this is slightly different to mdformat, in that obviously I am moreso the expert on MyST and know what needs to be in this package before I'm happy to start advertising/endorsing it on myst-parser etc. |
this seems like a bug of mdformat no? It should be able to understand when the paragraph is in an "indented environment". |
No I wouldn't consider this an mdformat bug. I made an issue in mdformat to document |
maybe have it as a context manager:
|
|
Yeah that needs to be added for sure, thanks for reminding me. I deliberately didn't add the context manager at the time to avoid making the indent system public API and "official" 😄 I think the alternative I considered was a bit reversed logic where there is a mapping from syntax name to indent width of that syntax, and then the paragraph render function, before wrapping, would add up the total indent width based on syntax types of its ancestors. Now thinking about it, I think the system in place (along with the context manager) is probably the better and more flexible way to do this. So maybe time to just create the context manager and document it. Anyways, the real problem with footnotes and any of these indent systems is that the first line is special and should be wrapped with a narrower indent width. |

No description provided.