// it being rendered as an inline block.
const prev = node.previousSibling;
const prevText = prev?.nodeType == 3 ? prev.textContent : "";
- const prevWrap = prevText.match(/\S*$/u)[0];
+ const prevWrap = prevText.match(/(?:(?!—)\S)*$/u)[0];
const next = node.nextSibling;
const nextText = next?.nodeType == 3 ? next.textContent : "";
- const nextWrap = nextText.match(/^\S*/u)[0];
+ const nextWrap = nextText.match(/^(?:(?!—)\S)*/u)[0];
if (prevWrap || nextWrap) {
const span = LMN.span.style("White-Space: Pre")``;
node.parentNode.replaceChild(span, node);