import {
createBlock,
getBlockType,
parse,
rawHandler,
} from '@wordpress/blocks';
import {
FAQ_BLOCK,
mergeNewFaqs,
type BlockLike,
type FaqPair,
} from './faq-merge';
/** The FAQ the agent writes, as it wraps it. */
const FAQ_SECTION =
/
]*class="[^"]*\bsection-faq\b[^"]*"[^>]*>[\s\S]*?<\/div>/gi;
/** Block markup carries its own comments; pasted HTML does not. */
const BLOCK_MARKUP = /';
const end = '';
const at = content.indexOf(end);
return at < 0
? `${toc}\n\n${content}`
: `${content.slice(0, at + end.length)}\n\n${toc}${content.slice(at + end.length)}`;
};