node_modules/mdsvex/dist/main.es.js
// Merge certain punctuation marks into their following words.
Merge certain punctuation marks into their following words.
Merge certain punctuation marks into their following words .
function mergeInitialWordSymbol(child, index, parent) {
  var children;
  var next;
  if (
    (child.type !== 'SymbolNode' && child.type !== 'PunctuationNode') ||
    nlcstToString_1(child) !== '&'
  ) {
    return
  }
  children = parent.children;
  next = children[index + 1];
  if (
    (index !== 0 && children[index - 1].type === 'WordNode') ||
    !(next && next.type === 'WordNode')
  ) {
    return
  }
  children.splice(index, 1);
  next.children.unshift(child);
  if (next.position && child.position) {
    next.position.start = child.position.start;
  }
  return index - 1
}
function mergeInitialWordSymbol ( child , index , parent ) { var children ; var next ; if ( ( child . type !== 'SymbolNode' && child . type !== 'PunctuationNode' ) || nlcstToString_1 ( child ) !== '&' ) { return } children = parent . children ; next = children [ index + 1 ] ; if ( ( index !== 0 && children [ index - 1 ] . type === 'WordNode' ) || ! ( next && next . type === 'WordNode' ) ) { return } children . splice ( index , 1 ) ; next . children . unshift ( child ) ; if ( next . position && child . position ) { next . position . start = child . position . start ; } return index - 1 }
Merge certain punctuation marks into their following words.
Merge certain punctuation marks into their following words .
// If either a previous word, or no following word, exists, exit early. // Remove `child` from parent. // Add the punctuation mark at the start of the next node. // Update position. // Next, iterate over the node at the previous position, as it's now adjacent // to a following word.