({ text, lang, escaped }: Tokens.Code)
| 23 | } |
| 24 | |
| 25 | code({ text, lang, escaped }: Tokens.Code): RendererOutput { |
| 26 | const langString = (lang || '').match(other.notSpaceStart)?.[0]; |
| 27 | |
| 28 | const code = text.replace(other.endingNewline, '') + '\n'; |
| 29 | |
| 30 | if (!langString) { |
| 31 | return '<pre><code>' |
| 32 | + (escaped ? code : escapeHtmlEntities(code, true)) |
| 33 | + '</code></pre>\n' as RendererOutput; |
| 34 | } |
| 35 | |
| 36 | return '<pre><code class="language-' |
| 37 | + escapeHtmlEntities(langString) |
| 38 | + '">' |
| 39 | + (escaped ? code : escapeHtmlEntities(code, true)) |
| 40 | + '</code></pre>\n' as RendererOutput; |
| 41 | } |
| 42 | |
| 43 | blockquote({ tokens }: Tokens.Blockquote): RendererOutput { |
| 44 | const body = this.parser.parse(tokens); |
no test coverage detected