Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* working at the first occurrence of the given string._
*
* @name options.before
*
* @example
* remark.use(behead, {weight: 1, before: '# Before this'})
* .process('# Hello\n# World\n# Before this')
*
* => '## Hello\n## World\n# Before this\n'
*/
if (opts.before) {
if (switched) {
return node
}
else {
if (remark.stringify(node) === opts.before) {
switched = true
return node
}
else {
return behead(node, opts)
}
}
}
/**
* Manipulates hading nodes between but not including the two given
* strings, starting with options.between[0] and ending with
* options.between[1].
*
* @name options.between
*