-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Fix problems with table rendering #1145
base: main
Are you sure you want to change the base?
Conversation
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1145 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 373 373
Branches 94 94
=========================================
Hits 373 373 ☔ View full report in Codecov by Sentry. |
The preview (https://json-schema-org-benjagm-fix-3r57.website-2v2.pages.dev/) seems to show a different page. |
Hi Karen. The url is a whole new deployment of the website. To reach to the specific page you need to make all the navigation steps. In this case this is the page you reported: https://json-schema-org-benjagm-fix-3r57.website-2v2.pages.dev/draft-06/json-schema-release-notes |
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.
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.
a few comments follow...
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.
I clicked around a bit more...
This file looks a bit off: https://json-schema-org-benjagm-fix-3r57.website-2v2.pages.dev/draft/2020-12/release-notes (at "$dynamicRef and $dynamicAnchor").
Also selecting the headings results in the underlying html ending up in the copy buffer, which is really weird! but I don't know if that's new, or an artifact of how the preview is generated.
And the links in the markdown tables at https://json-schema-org-benjagm-fix-3r57.website-2v2.pages.dev/draft/2019-09/release-notes are not rendering still.
@DarhkVoyd I spent some hours today trying to fix this without success. I know that the problem is that we need the markdown to be processed recursively for cases like these:
or
We are rendering the top-level element but not what it is inside. Do you have time to give it a try? |
In my opinion, we have correctly configured the Markdown to JSX transpiler. However, the issue lies within the package. The simplest solution here would be to write the Markdown as: | Keyword | Change | Notes |
| ------------------------------------------------------------------------------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| <a href="../../draft/2019-09/json-schema-validation.html#rfc.section.6.5.4">`dependentRequired` (split from `dependencies`)</a> | **split** | This is the string array form of `dependencies`; note that the standard meta-schema still reserves `dependencies` for backwards compatibility |
| <a href="../../draft/2019-09/json-schema-validation.html#rfc.section.6.4.4">`maxContains` and `minContains`</a> | **new** | Assertion for controlling how many times a subschema must be matched within an array |
|
Thanks for analyzing it DV. While this seems something valid when talking about link inside tables, there are scenarios where we have other stuff like code snippets using the default code block and this is not working as well: https://json-schema.org/draft/2020-12/release-notes#dollardynamicref-and-dollardynamicanchor I think what we have is just rendering once, and is not doing the job for other formats inside certain blocks. If we manage to recursively apply formatting we should be able to fix it. I tried this yesterday and managed to make it work for links and other formats, but not code blocks with code snippets. |
@benjagm Understood. I'll fix this. |
@benjagm I reviewed the library’s source code and the library does parse markdown recursively but the parse logic for table cell content is incorrect. Instead of treating cell content as a single string, it splits it into fragments and loses context, leading to incorrect plain text rendering. Regarding the code block, it is unrelated as table cells often fail to render properly due to unnecessary line breaks, the fix is simply to remove the unnecessary empty lines between For the original table parsing problem, I’ve submitted a detailed issue and suggested a fix for the parsing logic. You can find it here: quantizor/markdown-to-jsx#644 |
The submitted issue to fix the parsing logic has been attended and a fix has been merged. Should be soon available in a release. |
Thanks for the update DV! |
The release with fix is now available as v7.7.3. Let me know if anything else. |
@DarhkVoyd, Amazing job finding the problem, filing the issue in the markdown-to-jsx dependency, and tracking the problem!! Awesome job. I just updated the dependency, and the issue with most of the styles has been solved and the only one persisting is the one with the code editor to show code snippets inside cells: Any idea about what is causing this? |
Thanks DV. Now everything seems to work. I just re-requested reviews by everyone. |
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.
https://json-schema-org-benjagm-fix-3r57.website-2v2.pages.dev/draft/2020-12/release-notes#dollardynamicref-and-dollardynamicanchor still seems to be broken on the build preview but works as desired on the localhost, what am I missing? All else looks good to me.
Does this PR predate the PR build preview cache issue fix? Does its preview build still use the outdated cache workflow? Maybe updating this branch with the base main branch will fix this. |
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.
The preview works fine now! Looks good to me, ready to merge!
Now everything is fixed. |
Summary
It has been notified in slack an issue with the markdown tables rendering. This PR fixes it.