How to use html-whitespace-sensitive-tag-names - 2 common examples

To help you get started, we’ve selected a few html-whitespace-sensitive-tag-names 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 Prettyhtml / prettyhtml / packages / prettyhtml-hast-to-html / lib / all.js View on Github external
function getInnerTextLength(node) {
  // ignore style, script, pre, textarea elements
  if (sensitive.indexOf(node.tagName) !== -1) {
    return 0
  }

  if (!node.children || !node.children.length) {
    return 0
  }

  var child = node.children[0]

  if (child.type === 'text' || child.type === 'comment') {
    return child.value.split('\n')[0].length
  }

  return 0
}
github Prettyhtml / prettyhtml / packages / prettyhtml-formatter / index.js View on Github external
function ignore(nodes) {
  let index = nodes.length

  while (index--) {
    if (sensitive.indexOf(nodes[index].tagName) !== -1) {
      return true
    }
  }

  return false
}

html-whitespace-sensitive-tag-names

List of whitespace sensitive HTML tag names

MIT
Latest version published 8 months ago

Package Health Score

64 / 100
Full package analysis

Popular html-whitespace-sensitive-tag-names functions