Sha256: e936a1610c81c52db4d4d1ccbc36dc255e649a1c48a7be21d8de56b36e6b4102

Contents?: true

Size: 501 Bytes

Versions: 1

Compression:

Stored size: 501 Bytes

Contents

module.exports = hardBreak

var patternInScope = require('../util/pattern-in-scope')

function hardBreak(node, _, context, safe) {
  var index = -1

  while (++index < context.unsafe.length) {
    // If we can’t put eols in this construct (setext headings, tables), use a
    // space instead.
    if (
      context.unsafe[index].character === '\n' &&
      patternInScope(context.stack, context.unsafe[index])
    ) {
      return /[ \t]/.test(safe.before) ? '' : ' '
    }
  }

  return '\\\n'
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 node_modules/mdast-util-to-markdown/lib/handle/break.js