INNER CODE UNIT · TypeScript

blockTo

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

            const blockTo = pos + node.nodeSize - 1;

            // find all valid links that should exist in this block
            const desiredLinks: Array<{
              start: number;
              end: number;
              href: string;
            }> = [];

            for (const run of extractRuns(node, pos, schema)) {
              for (const match of run.text.matchAll(WHITESPACE_RE)) {
                const word = match[0];
                const wordStart = run.startPos + match.index!;
                const wordEnd = wordStart + word.length;

                const ranges = findAutolinkRangesInWord(word, state.linkRegex);
                const fullMatch = ranges.some(
                  (r) => r.start === 0 && r.endExclusive === word.length

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…