'use client' import { findUnescapedCharacter } from '@admin/utils/editor/find-unescaped-character' import { findUnescapedSequence } from '@admin/utils/editor/find-unescaped-sequence' export function findInlineMathStart(src: string) { const dollarIndex = findUnescapedCharacter(src, '$', 0) const parenIndex = findUnescapedSequence(src, '\\(', 0) const indexes = [dollarIndex, parenIndex].filter((index) => index >= 0) return indexes.length > 0 ? Math.min(...indexes) : -1 }