-
Notifications
You must be signed in to change notification settings - Fork 330
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
Special characters breaking project pages #1143
Comments
This issue is still happening on https://datahub.io/core/world-religion-projections - i think we probably want a way to fix this. |
ShapingProblem:MDX parser interprets special characters "<" and ">" and alikes in README files as special syntax, causing 500 errors on the project page. Appetite:~ 1 week to implement a robust solution. Rabbit-holes:
No Gos:
Solution:Write a regex to escape characters properly |
@LuisVCSilva where is the "Solution" part? :) The "Rabbit holes" should be any potential facets of the solution you're sketching that you're either not sure of or that have a potential of draining lots of resources on resolving them. Those can also be any questions that might have come up to you and you don't have answers to them yet. No-goes are usually rabbit-holes that you can safely discard - you think they are not worth working on. |
@olayway Edits made, thanks! |
It shouldn't take more than 1 day |
@LuisVCSilva also IMO the solution should be worked out in much more detail b4 implementation here e.g. where in the code will you likely make these changes? Will you write tests? If so where ... Is this just And what about things like Do you actually need to fix this or do we just need to report to users what the error relates to so they can fix it (getting into regexes to fix stuff is a potentially complex business - or maybe it is very simple ...) Have you done any research online e.g. googling about this issue. PS: does this relate to #1206? |
SituationFacing difficulties with READMEs that contain certain special characters, specially "<" and ">". ProblemMDX throws an error whenever special characters like Solution
AppetiteImplementation should be pretty quick(15-30 mins), also writing different test cases might take some time to test(1-2h). Rabbit-holes
No-goes
Appendix |
@gradedSystem Ok, let's just do this. I think we're making it more complicated than it actually is at this point. For now let's just check Hint: we you want to escape these characters before this line: https://github.com/datopian/datahub-next/blob/34c53cdc9d9a1dbd96e6ce08f219c9e064e698b1/lib/markdown.ts#L30 Also, I advise starting by writing tests and coding the solution second. |
I just did the shaping and thought to include above too😅, ok noted will start working on tests before solution |
FIXED |
Reopening as we haven't thought about some cases and the current solution breaks e.g. callouts and mermaid diagrams. |
WONTFIX Closing as wont-fix as there are too many edge cases and supporting this would require quite a lot of work. For now any standalone > or < that are causing errors need to be escaped with expressions: |
We are facing some difficulties with READMEs that contain certain special characters, specially "<" and ">".
The issue is that our MDX parser interprets that as a special syntax and causes 500 errors on the project page. See the example on the notes.
To fix this issue, we could escape special characters on README, so instead of:
>
Have:
The problems with this approach are that:
A better approach would be to find a way to make our parser ignore errors like this OR automatically escape these characters since we don't really use this syntax anywhere.
Notes
Example:
Take a look at:
https://datahub.io/core/world-religion-projections
If we access this dataset on a dev environment, the following error can be found:
Note that what's breaking the page is this part of the README:
The text was updated successfully, but these errors were encountered: