(_: string, innerText: string)
| 131 | if (!/warichuu?|<warichu/i.test(result)) return result; |
| 132 | |
| 133 | const replace = (_: string, innerText: string) => { |
| 134 | const { html, text } = sanitizeInnerHTML(innerText); |
| 135 | if (!text) return ''; |
| 136 | const { open, content, close } = extractParens(text); |
| 137 | // Also extract parens from the HTML version, keeping tags intact |
| 138 | const htmlParens = extractHtmlParens(html, open, close); |
| 139 | return ( |
| 140 | `<span class="warichu-pending"` + |
| 141 | ` data-open="${escapeAttr(open)}"` + |
| 142 | ` data-close="${escapeAttr(close)}"` + |
| 143 | ` data-text="${escapeAttr(content)}"` + |
| 144 | ` data-html="${escapeAttr(htmlParens)}"` + |
| 145 | `>${open}${content}${close}</span>` |
| 146 | ); |
| 147 | }; |
| 148 | |
| 149 | result = result.replace(WARICHU_SPAN_REGEX, replace); |
| 150 | result = result.replace(WARICHU_ELEMENT_REGEX, replace); |
nothing calls this directly
no test coverage detected