INNER CODE UNIT · TypeScript

WHITESPACE_RE

software-mansion/react-native-enriched-html · src/web/pmPlugins/AutolinkPlugin/index.ts:27

const WHITESPACE_RE = /\S+/g;

function removeAutoLinksInRange(
  doc: Node,
  tr: Transaction,
  linkType: MarkType,
  from: number,
  to: number
): void {
  if (from >= to) return;

  doc.nodesBetween(from, to, (node, pos) => {
    if (!node.isText) return true;

    const link = linkType.isInSet(node.marks);
    if (link?.attrs.auto === true) {
      tr.removeMark(
        Math.max(from, pos),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…