Skip to content

oliverv/caro / .agents/skills/oma-hwp

oma-hwp

Flagged

Convert Hangul HWP, HWPX, or HWPML documents to Markdown with kordoc. Use for text, table, and image extraction from these formats.

resources/balanced-tables.ts

View on GitHub
/**
 * Replace balanced outermost table blocks. Nested tables are passed to the
 * callback as part of their parent instead of being truncated at the first
 * closing tag.
 */
export function replaceBalancedTables(
  source: string,
  replace: (tableHtml: string) => string,
): string {
  const tag = /<\/?table\b[^>]*>/gi;
  let depth = 0;
  let blockStart = -1;
  let cursor = 0;
  let output = "";

  for (let match = tag.exec(source); match; match = tag.exec(source)) {
    const closing = /^<\/table/i.test(match[0]);
    if (!closing) {
      if (depth === 0) {
        blockStart = match.index;
        output += source.slice(cursor, blockStart);
      }
      depth += 1;
      continue;
    }

    if (depth === 0) continue;
    depth -= 1;
    if (depth === 0 && blockStart >= 0) {
      const blockEnd = tag.lastIndex;
      output += replace(source.slice(blockStart, blockEnd));
      cursor = blockEnd;
      blockStart = -1;
    }
  }

  // Preserve malformed/unclosed input verbatim rather than dropping content.
  return output + source.slice(blockStart >= 0 ? blockStart : cursor);
}
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall