INNER CODE UNIT · TypeScript

extractRuns

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

function extractRuns(
  block: Node,
  blockStartPos: number,
  schema: Schema
): Run[] {
  const runs: Run[] = [];
  let current: Run | null = null;

  block.forEach((child, offset) => {
    const eligibleText =
      child.isText &&
      child.text &&
      !schema.marks.code?.isInSet(child.marks) &&
      !schema.marks.mention?.isInSet(child.marks);

    if (eligibleText) {
      if (!current) {
        current = { text: '', startPos: blockStartPos + 1 + offset };

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…