node_modules/mdsvex/dist/main.es.js
// Merge certain punctuation marks into their preceding words.
Merge certain punctuation marks into their preceding words.
Merge certain punctuation marks into their preceding words .
function mergeFinalWordSymbol$1(child, index, parent) {
  var children;
  var prev;
  var next;
  if (
    index !== 0 &&
    (child.type === 'SymbolNode' || child.type === 'PunctuationNode') &&
    nlcstToString_1(child) === '-'
  ) {
    children = parent.children;
    prev = children[index - 1];
    next = children[index + 1];
    if (
      (!next || next.type !== 'WordNode') &&
      prev &&
      prev.type === 'WordNode'
    ) {
      children.splice(index, 1);
      prev.children.push(child);
      if (prev.position && child.position) {
        prev.position.end = child.position.end;
      }
      return index
    }
  }
}
function mergeFinalWordSymbol$1 ( child , index , parent ) { var children ; var prev ; var next ; if ( index !== 0 && ( child . type === 'SymbolNode' || child . type === 'PunctuationNode' ) && nlcstToString_1 ( child ) === '-' ) { children = parent . children ; prev = children [ index - 1 ] ; next = children [ index + 1 ] ; if ( ( ! next || next . type !== 'WordNode' ) && prev && prev . type === 'WordNode' ) { children . splice ( index , 1 ) ; prev . children . push ( child ) ; if ( prev . position && child . position ) { prev . position . end = child . position . end ; } return index } } }
Merge certain punctuation marks into their preceding words.
Merge certain punctuation marks into their preceding words .
// Remove `child` from parent. // Add the punctuation mark at the end of the previous node. // Update position. // Next, iterate over the node *now* at the current position (which was // the next node).