|
1 | 1 | import Prism, { Grammar } from 'prismjs' |
2 | 2 | import loadLanguages from 'prismjs/components/' |
3 | | -import MarkdownIt from 'markdown-it' |
4 | | -import Renderer, { RenderRule } from 'markdown-it/lib/renderer' |
5 | | -import StateCore from 'markdown-it/lib/rules_core/state_core' |
6 | | -import Token from 'markdown-it/lib/token' |
| 3 | +import MarkdownIt, { Renderer, StateCore, Token } from 'markdown-it' |
7 | 4 |
|
8 | 5 | const SPECIFIED_LANGUAGE_META_KEY = 'de.joshuagleitze.markdown-it-prism.specifiedLanguage' |
9 | 6 | type SelectedPrismLanguage = [string, Grammar | undefined] |
@@ -196,7 +193,7 @@ function extractInlineCodeSpecifiedLanguage(inlineCodeToken: Token, followingTok |
196 | 193 | * @param existingRule |
197 | 194 | * The previously configured render rule for fenced code blocks. |
198 | 195 | */ |
199 | | -function applyCodeAttributes(markdownit: MarkdownIt, options: Options, existingRule: RenderRule): RenderRule { |
| 196 | +function applyCodeAttributes(markdownit: MarkdownIt, options: Options, existingRule: Renderer.RenderRule): Renderer.RenderRule { |
200 | 197 | return (tokens, idx, renderOptions, env, self) => { |
201 | 198 | const fenceToken = tokens[idx] |
202 | 199 | const info = fenceToken.info ? markdownit.utils.unescapeAll(fenceToken.info).trim() : '' |
@@ -229,7 +226,7 @@ function applyCodeAttributes(markdownit: MarkdownIt, options: Options, existingR |
229 | 226 | * @param existingRule |
230 | 227 | * The previously configured render rule for inline code. |
231 | 228 | */ |
232 | | -function renderInlineCode(markdownit: MarkdownIt, options: Options, existingRule: RenderRule): RenderRule { |
| 229 | +function renderInlineCode(markdownit: MarkdownIt, options: Options, existingRule: Renderer.RenderRule): Renderer.RenderRule { |
233 | 230 | return (tokens, idx, renderOptions, env, self) => { |
234 | 231 | const inlineCodeToken = tokens[idx] |
235 | 232 | const specifiedLanguage = inlineCodeToken.meta ? (inlineCodeToken.meta[SPECIFIED_LANGUAGE_META_KEY] || '') : '' |
|
0 commit comments