Open linonetwo opened 2 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
tiddlywiki5 | ✅ Ready (Inspect) | Visit Preview | Jun 12, 2024 5:39pm |
The problem here is, that the output of you test does not produce the same rendered HTML output as the original source. See the screenshot.
First line is wrapped by a p element, but I haven't find the rule that produce the p element. And there was no p html in the source, so I may need to add some attribute to ast to show this p element is "fake".
Anyway, this is just a demo for API, do you like the API name and their usage? The further task is just adding exports.serailize = xxx
to each rule.
First line is wrapped by a p element, but I haven't find the rule that produce the p element. And there was no p html in the source, so I may need to add some attribute to ast to show this p element is "fake".
IMO the current parser has a "systemic" problem with redundant P-tags, that we probably may need to solve first.
Working around this problem with "fake" elements will just increase your code complexity, instead of solving the underlaying problem. It will also create an other dependency, that will make solving the problem, in the core, in backwards compatible way even harder as it is now.
redundant P-tags
Can't remove then, many of my plugin style sheet is already depending on this structure. And p > text
for block is following HTML5 semantic.
Another option is handle it like text node, regard it as a special case.
And
p > text
for block is following HTML5 semantic.
That's true, but we do have a lot of p > div
which should not happen at all.
closes #8255
Currently just a demo, I will gradually move code from https://github.com/tiddly-gittly/wikiast/tree/master/packages/wikiast-util-to-wikitext to here.
Try it with tiddler (Well, if official website have share plugin installed, I can put a link here):
and run this in console: