How to use the snapdragon-util.hasOpenAndClose 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 here-be / snapdragon / lib / parser.js View on Github external
eos: function() {
    if (this.input) return;
    var pos = this.position();
    var prev = this.prev();

    while (prev.type !== 'root' && !prev.visited) {
      if (this.options.strict === true) {
        throw new SyntaxError('invalid syntax:' + prev);
      }

      if (!util.hasOpenAndClose(prev)) {
        define(prev.parent, 'escaped', true);
        define(prev, 'escaped', true);
      }

      this.visit(prev, function(node) {
        if (!util.hasOpenAndClose(node.parent)) {
          define(node.parent, 'escaped', true);
          define(node, 'escaped', true);
        }
      });

      prev = prev.parent;
    }

    var node = pos(this.node(this.append || '', 'eos'));
    if (typeof this.options.eos === 'function') {
github here-be / snapdragon / lib / parser.js View on Github external
this.visit(prev, function(node) {
        if (!util.hasOpenAndClose(node.parent)) {
          define(node.parent, 'escaped', true);
          define(node, 'escaped', true);
        }
      });