How to use the domutils.getText function in domutils

To help you get started, we’ve selected a few domutils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fb55 / htmlparser2 / lib / FeedHandler.js View on Github external
function fetch(what, where, recurse) {
    return DomUtils.getText(
        DomUtils.getElementsByTagName(what, where, recurse, 1)
    ).trim();
}
github Janpot / microdata-node / lib / microdataDom.js View on Github external
if (isName(element, srcProperty)) {
      return resolveUrlProperty(DOM.getAttributeValue(element, 'src'));
    }
    if (isName(element, hrefProperty)) {
      return resolveUrlProperty(DOM.getAttributeValue(element, 'href'));
    }
    if (isName(element, [ 'object' ])) {
      return resolveUrlProperty(DOM.getAttributeValue(element, 'data'));
    }
    if (isName(element, [ 'data', 'meter' ])) {
      return resolveNumberProperty(DOM.getAttributeValue(element, 'value'));
    }
    if (isName(element, [ 'time' ])) {
      return resolveDateProperty(DOM.getAttributeValue(element, 'datetime'));
    }
    var value = DOM.getText(element);
    if (value || strict) {
      return resolveProperty(value);
    }

    return resolveProperty('');
  }
github broadly / css-inliner / lib / extract_rules.js View on Github external
function extractFromElementAsync(cache, element) {
  if (isStyleElement(element)) {

    DOMUtils.removeElement(element);
    const css           = DOMUtils.getText(element);
    const resultPromise = cache.compileAsync(css);
    return resultPromise;

  } else if (isLocalStylesheet(element)) {

    DOMUtils.removeElement(element);
    const relativeURL   = DOMUtils.getAttributeValue(element, 'href');
    const resultPromise = cache.loadAsync(relativeURL);
    return resultPromise;

  } else
    return Promise.resolve({});
}
github Rainbox-dev / DuAEF_Duik / Release / Duik-API / src-doc / tui-jsdoc-template / node_modules / htmlparser2 / lib / FeedHandler.js View on Github external
function fetch(what, where, recurse) {
    return DomUtils.getText(
        DomUtils.getElementsByTagName(what, where, recurse, 1)
    ).trim();
}
github superfly / fly / packages / v8env / src / document.ts View on Github external
get textContent() {
    return getText(this._dom)
  }