(text)
| 44 | |
| 45 | /** Utility functions extracted from the MarkdownTheme plugin */ |
| 46 | export function backTicks(text) { |
| 47 | // If the input string itself contains a pipe, or backslash (which can result in unwanted side effects) the string is escaped instead. |
| 48 | if (/(\||\\)/g.test(text)) { |
| 49 | return escapeChars(text); |
| 50 | } |
| 51 | // If the input string itself contains a backtick, the string is wrapped in double backticks. |
| 52 | if (/`/g.test(text)) { |
| 53 | return `\`\` ${text} \`\``; |
| 54 | } |
| 55 | // Otherwise, the string is wrapped in single backticks. |
| 56 | return `\`${text}\``; |
| 57 | } |
| 58 | |
| 59 | class GrokThemeRenderContext extends MarkdownThemeContext { |
| 60 | constructor(theme, page, options) { |
no test coverage detected