Bug: Phenomic does not render markdown tables #1098
Comments
Thanks for reporting this. I think we have a (probably) too brutal sanitizer Can you check if your stuff and tell me if the sanitizer is the problem? FYI t: tag |
Thanks @MoOx for getting back to me on this issue. I don't think the sanitizer is the issue here. Logically, phenomic is using the github schema to sanitize the hast syntax tree, but github supports tables so I would assume phenomic wouldn't have an issue. In addition, I pulled the input and output of remark-react's sanitize call and the correct tagNames are there in the input and the output hast trees. However, when inspecting remark-react I figured out the issue as it's actually an issue with remark-react, not phenomic. The issue is this line. FWIW: once the remark-react issue is fixed phenomic will have a different issue here. The issue will be the
The logic here could be tricky because the |
Thanks for this explanation. |
(I think we can simply override td/th components created in remark-react, and just use a string, even if it's a regression somehow... remarkjs/remark-react@c91d4cd |
Ok. Mind if I put together a PR for that? It could take a few days because I'm on a short vacation right now. |
Yeah, feel free to take a look ! Thanks!
|
@owenhoskins I am actually working on this while fixing #817. Except a fix soon (I have a wip that is actually ready). |
This plugin now use [unified](http://unifiedjs.github.io) directly instead of [remark](https://github.com/wooorm/remark) so we can mix remark with [rehype](https://github.com/wooorm/rehype) to allow custom markup. This will open up usage of custom react components when rendering markdown tree with a custom mapping. Closes [#187](#817) Closes [#1098](#1098)
Phenomic has an issue rendering markdown tables. Please see the snippet of markdown below:
It is rendered as this:
The html generated is this:
The
<th>
and<td>
tags are missing when the markdown syntax tree is rendered by the BodyRenderer.I think the issue is in the preprocessed markdown syntax tree that is being passed into the browser at run time. The above markdown is passed to the browser as this:
The attribute "t" on the leaf nodes in the syntax tree are not set.
I'm not sure if this is an issue in phenomic or phenomic's use of remark to preprocess markdown files. I'm happy to dig in more and put together a PR, just let me know. The BodyRenderer is a core part of phenomic and phenomic is in active development so I'm holding off for now.
The text was updated successfully, but these errors were encountered: