Open EvitanRelta opened 1 year ago
Hi @EvitanRelta, thanks for reaching out!
I've switched to using a proper noop rule for the <article>
tag locally, but I'm going to keep encountering that kind of issue with every tag that HTMLardown doesn't understand (so far I've also encountered oddball tags like <figure>
and <picture>
not working). Ideally there would be a way to make all unknown tags a no-op/passthrough as opposed to just dropping their contents.
I'm replacing
s just because the ultimate destination for the markdown doesn't support them, not sure thats something HTMLarkdown should care about
yo sflr! Have been busy with school work.
Alright thanks for the feedback!
In the future, I'm planning to add
like any other whitespace (ie. <p>A B</p>
converts to A B
) (fixing ur 2nd issue)But for now, to fix ur 1st issue, u could do:
const htmlarkdown = new HTMLarkdown()
/** Noop rule, that is associated with any element. */
const blanketNoopRule: Rule = {
filter: [() => true],
replacement: () => innerContent => innerContent
}
// Set the rule to run LAST, after all other rules.
// This will make it so that it's the "default rule", should an element not
// match any other rule.
htmlarkdown.addRule(blanketNoopRule, false)
Hello!
I'm the maintainer of HTMLarkdown, and saw u were using the package.
I haven't really tried using it beyond Jest unit tests, so I was wondering if u've encountered any problem with it? or got any feedback/questions on it?
I see that ure removing
<article>
tags and replacing
with spaces in ur code snippet below, so im guessing its not working as u hoped?Also, sorry for the lack of documentations for adding custom rules.
Haven't got around adding those yet, but I can help if u need a specific feature from HTMLarkdown!