You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's currently no option for that, but it would be relatively simple to create this. Right now the library already has a built-in list of "void elements" such as <br> that should never be closed. I think the easiest approach (if you know which tags you might encounter in your situation) is to allow extending that list, and I'd happily accept a PR for that.
If it could be any tag, it would be a little more involved, because then the behavior would need to be reversed and it would need to rely on a "non-void elements" list, which it currently does not have.
I could also possibly offer a workaround, because if I'm not mistaken, if you passed <fox/> instead of <fox> it should already be recognized as self-closing and you'd get the desired behavior. So if this is possible for you, a little preprocessing might do the trick then.
When clipping HTML, would it be possible to not add a closing tag for strings that aren't actually HTML tags?
So if I do something like this:
Since
<fox>
isn't actually a valid HTML tag, I'm hoping to get:instead of:
The text was updated successfully, but these errors were encountered: