dom-parser icon indicating copy to clipboard operation
dom-parser copied to clipboard

[bug] Support tags with hyphen in them

Open math2001 opened this issue 8 years ago • 2 comments
trafficstars

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 avatar Sep 01 '17 07:09 math2001

@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

kstarzyk avatar Oct 02 '17 21:10 kstarzyk

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!!!

cdmoro avatar Apr 21 '19 04:04 cdmoro

The issue is fixed by https://github.com/ershov-konst/dom-parser/pull/28 Many thanks @kstarzyk for the Initial PR

ershov-konst avatar Nov 07 '23 09:11 ershov-konst