How to use the ElementType function from htmlparser2

Find comprehensive JavaScript htmlparser2.ElementType code examples handpicked from public code repositorys.

81
82
83
84
85
86
87
88
89
90
for (var i = 0; i < elems.length; i++) {
    var elem = elems[i];
    if (htmlparser2_1.DomUtils.isText(elem))
        ret += elem.data;
    else if (htmlparser2_1.DomUtils.hasChildren(elem) &&
        elem.type !== htmlparser2_1.ElementType.Comment &&
        elem.type !== htmlparser2_1.ElementType.Script &&
        elem.type !== htmlparser2_1.ElementType.Style) {
        ret += text(elem.children);
    }
fork icon12
star icon1
watch icon0

+ 5 other calls in file

29
30
31
32
33
34
35
                                                                                                                                                                                                                   * Map each htmlparser2 element type to a function which will convert that element type to a React element
                                                                                                                                                                                                                   * Not all of the element types are supported so the UnsupportedElementType is used for them which will not return any
                                                                                                                                                                                                                   * value
                                                                                                                                                                                                                   */


exports.default = (_ElementType$Text$Ele = {}, _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Text, _TextElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Tag, _TagElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Style, _StyleElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Directive, _UnsupportedElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Comment, _UnsupportedElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Script, _UnsupportedElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.CDATA, _UnsupportedElementType2.default), _defineProperty(_ElementType$Text$Ele, _htmlparser.ElementType.Doctype, _UnsupportedElementType2.default), _ElementType$Text$Ele);
fork icon0
star icon0
watch icon0