(description: string)
| 8 | } |
| 9 | |
| 10 | export default function parseBackticks(description: string): DocumentFragment { |
| 11 | const fragment = new DocumentFragment(); |
| 12 | for (const [index, text] of getParsedBackticksParts(description).entries()) { |
| 13 | if (index % 2 && text.length > 0) { |
| 14 | // `span.sr-only` keeps the backticks copy-pastable but invisible |
| 15 | fragment.append( |
| 16 | <span className="sr-only">`</span>, |
| 17 | <code className="rgh-parse-backticks">{text.trim()}</code>, |
| 18 | <span className="sr-only">`</span>, |
| 19 | ); |
| 20 | } else if (text.length > 0) { |
| 21 | fragment.append(text); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | return fragment; |
| 26 | } |
nothing calls this directly
no test coverage detected