Sha256: d18c55d33fb06f6609f866ea7784370b8cb266ebb97ac937dea125fcb57b28ad

Contents?: true

Size: 759 Bytes

Versions: 23

Compression:

Stored size: 759 Bytes

Contents

'use strict'

var identity = require('./identity')

module.exports = enter

// Shortcut and collapsed link references need no escaping and encoding during
// the processing of child nodes (it must be implied from identifier).
//
// This toggler turns encoding and escaping off for shortcut and collapsed
// references.
//
// Implies `enterLink`.
function enter(compiler, node) {
  var encode = compiler.encode
  var escape = compiler.escape
  var exitLink = compiler.enterLink()

  if (node.referenceType !== 'shortcut' && node.referenceType !== 'collapsed') {
    return exitLink
  }

  compiler.escape = identity
  compiler.encode = identity

  return exit

  function exit() {
    compiler.encode = encode
    compiler.escape = escape
    exitLink()
  }
}

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
trusty-cms-5.0.7 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-5.0.6 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-5.0.5 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-5.0.4 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-5.0.3 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-5.0.2 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-5.0.1 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-4.3.5 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-5.0.0 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-4.3.4 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-4.3.3 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-4.3.2 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-4.3.1 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-4.3 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-4.2.3 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-4.2.2 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-4.2.1 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-4.2 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-4.1.9 node_modules/remark-stringify/lib/util/enter-link-reference.js
trusty-cms-4.1.8 node_modules/remark-stringify/lib/util/enter-link-reference.js