How to use the snapdragon-util.toNoop function in snapdragon-util

To help you get started, we’ve selected a few snapdragon-util 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 breakdance / breakdance / lib / html.js View on Github external
}
      }

      if (node.name === 'li') {
        $('p', node).each(function(i, ele) {
          var str = $(this).html().trim();
          if (i > 0) str = ' ' + str;
          var span = $('<span></span>').html(str);
          $(this).replaceWith(span);
        });
      }

      if ((node.name === 'ul' || node.name === 'ol' || node.name === 'li')) {
        node.text = $(node).text();
        if (!node.text.trim()) {
          util.toNoop(node, true);
        }
      }

      if (node.name === 'pre') {
        node.outer = stripAttr($.html(node));
        var html = $(node).html();

        if (html) {
          var code = $('code', node) || {};
          var codeInner = opts.literalPre === true
            ? code.html &amp;&amp; code.html()
            : code.text &amp;&amp; code.text();

          var text = codeInner || $(node).text();

          node.gfm = true;