I need to fix a Javascript bug
- or -
Post a project like this$10
- Posted:
- Proposals: 1
- Remote
- #2069866
- Expired
Description
Experience Level: Entry
The current implementation of Markdown rendering is uploaded above. Basically, it takes the stream of tokens generated from MD markup by markdown-it and generates JSX code matching those tokens. As you see on the line 166, html_block rule of markdown-it render is disabled. The reason is: the standard html_block rule converts an HTML block into single token containing that HTML, and does not further parse inner content of the HTML block, which is necessary for us to support custom JSX/HTML tags (see lines ##30-36: at the moment we allow to use 5 custom tags, which map to various compnents of Community App).
With html_block disabled HTML code is still parsed by markdown-it as inline HTML code, which allows us to further map some tokens into custom components, but the problem is that it also takes into account the standard MD rules inside such blocks, which, in various cases, results in unexpected rendering results. For example, the code like this
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
std::cout << “test”;
}
}
Is not rendered correctly, because the empty line is treated as a paragraph break (according to MD rules). You should fix it. Presumably it can be done by taking the standard html_block rule from markdown-it and writing, based on it, our custom rule, which will still parse inline elements inside HTML blocks, but only following HTML rules (and support of custom JSX components), but not markdown rules inside such blocks.
With html_block disabled HTML code is still parsed by markdown-it as inline HTML code, which allows us to further map some tokens into custom components, but the problem is that it also takes into account the standard MD rules inside such blocks, which, in various cases, results in unexpected rendering results. For example, the code like this
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
std::cout << “test”;
}
}
Is not rendered correctly, because the empty line is treated as a paragraph break (according to MD rules). You should fix it. Presumably it can be done by taking the standard html_block rule from markdown-it and writing, based on it, our custom rule, which will still parse inline elements inside HTML blocks, but only following HTML rules (and support of custom JSX components), but not markdown rules inside such blocks.
Jedidiah O.
0% (0)Projects Completed
-
Freelancers worked with
-
Projects awarded
0%
Last project
9 May 2024
Nigeria
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies