dom-parser
dom-parser copied to clipboard
[bug] Support tags with hyphen in them
For instance, this doesn't work:
const dom = HTMLParser('<tip-link>test</tip-link>')
console.log(dom.getElementsByTagName('tip-link'))
It gives an empty list.
@math2001 Not sure if @ershov-konst supports this great lib any longer but I needed to make this fix for myself:
Added support for multiple :,_ and - in tag names https://github.com/ershov-konst/dom-parser/pull/6 + tests
Hi! I know we are in 2019... but I was testing the PR and I found a little error, when I want to see the innerHTML of an element wich inside has a tag with '-' I see only the first part of the tag.
For example, I do getElementById("v-app") on this html
<div id="v-app">
<b-container class="mt-3">
<b-card>Hello, {{ message }}</b-card>
</b-container>
</div>
and when I get the innerHTML I see
<b class="mt-3">
<b>Hello, {{ message }}</b>
</b>
It's a bit frustrating, I look the code but I couldn't make it work. I don't want to see all my code in bold XD... Anyone can fix this? Thanks!!!
The issue is fixed by https://github.com/ershov-konst/dom-parser/pull/28 Many thanks @kstarzyk for the Initial PR