New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppresses header check inside frontmatter #14203
Conversation
Thanks for making a pull request to jupyterlab! |
front: matter^^^ that's some frontmatter Ha, hadn't even looked at the implementation... figured it actually used the markdown parser or something. That's a lot of heuristics. But this is markdown, which seems to be made entirely of heuristics. The changed seems reasonable, but I imagine some more cases around the .rst-like/ ---
front: matter
---
Not-front-matter
===
Really-not-front-matter
---
Not even looking
~~~
> ^^^ this is probably an alternate code block
|
Oh, and the (very whitespace-sensitive) "semantic break" that makes a
|
@bollwyvl Since this is front matter, should we only do the frontmatter check once, on the very first line of the file? That would prevent the horizontal rule |
thanks @JasonWeill
Yes we should only check for the very first line; switch to a logic:
Another reason is that your current implementation will not work with the following case:
I'm pretty sure the current logic will escape the second title. I'm 👍 for reusing the markdown parsing (especially as we are already parsing twice the string, once by CM and once by marked.js). But let's open a follow-up issue as it will require more complex changes. |
Yep: I guess we're trying to match upstream GFM: here are some weird cases: https://gist.github.com/bollwyvl/84f19e4bcb3a6d5a8d23a26a5bcaf329 Here are some weird edge cases. |
fc80fa5
to
3ba23f5
Compare
1be1d11
to
1fca3f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @JasonWeill
Benchmark reportThe execution time (in milliseconds) are grouped by test file, test type and browser. The mean relative comparison is computed with 95% confidence. Results table
Changes are computed with expected as reference.
Waiting for localhost:8888 Cell memory leaksCreate a code cellMemory change: +157 kB Leak detected: YesLeaking objects:
Leaking collections: Create a markdown cellMemory change: -135 kB Leak detected: NoLeaking objects:
Leaking collections: Create a raw cellMemory change: +143 kB Leak detected: YesLeaking objects:
Leaking collections:
File editor memory leaksCreate a fileMemory change: -73.5 kB Leak detected: NoLeaking objects:
Notebook memory leaksCreate a notebookMemory change: +31.5 kB Leak detected: YesLeaking objects:
2 passing (6m)
|
References
Fixes #14200.
Code changes
Suppresses Markdown header check inside YAML frontmatter, defined as lines surrounded by
---
on a line by itself.User-facing changes
In the Markdown block below,
Summary
andMotivation
are recognized as headings, and nothing in the frontmatter is.Backwards-incompatible changes
None.