|
|
|
@ -108,44 +108,11 @@ function normalizeLinkText (url: string): string { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* class MarkdownIt |
|
|
|
* |
|
|
|
* Main parser/renderer class. |
|
|
|
* |
|
|
|
* ##### Usage |
|
|
|
* |
|
|
|
* ```javascript
|
|
|
|
* // node.js, "classic" way:
|
|
|
|
* var MarkdownIt = require('markdown-it'), |
|
|
|
* md = new MarkdownIt(); |
|
|
|
* var result = md.render('# markdown-it rulezz!'); |
|
|
|
* |
|
|
|
* // node.js, the same, but with sugar:
|
|
|
|
* var md = require('markdown-it')(); |
|
|
|
* var result = md.render('# markdown-it rulezz!'); |
|
|
|
* |
|
|
|
* // browser without AMD, added to "window" on script load
|
|
|
|
* // Note, there are no dash.
|
|
|
|
* var md = window.markdownit(); |
|
|
|
* var result = md.render('# markdown-it rulezz!'); |
|
|
|
* ``` |
|
|
|
* |
|
|
|
* Single line rendering, without paragraph wrap: |
|
|
|
* |
|
|
|
* ```javascript
|
|
|
|
* var md = require('markdown-it')(); |
|
|
|
* var result = md.renderInline('__markdown-it__ rulezz!'); |
|
|
|
* ``` |
|
|
|
**/ |
|
|
|
|
|
|
|
/** |
|
|
|
* new MarkdownIt([presetName, options]) |
|
|
|
* - presetName (String): optional, `commonmark` / `zero` |
|
|
|
* - options (Object) |
|
|
|
* |
|
|
|
* Creates parser instanse with given config. Can be called without `new`. |
|
|
|
* Creates a parser instance with the given config. Can be called without `new`. |
|
|
|
* |
|
|
|
* ##### presetName |
|
|
|
* The optional `presetName` can be `commonmark` or `zero`. |
|
|
|
* |
|
|
|
* MarkdownIt provides named presets as a convenience to quickly |
|
|
|
* enable/disable active syntax rules and options for common use cases. |
|
|
|
@ -159,7 +126,7 @@ function normalizeLinkText (url: string): string { |
|
|
|
* all rules disabled. Useful to quickly setup your config via `.enable()`. |
|
|
|
* For example, when you need only `bold` and `italic` markup and nothing else. |
|
|
|
* |
|
|
|
* ##### options: |
|
|
|
* Available options: |
|
|
|
* |
|
|
|
* - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful! |
|
|
|
* That's not safe! You may need external sanitizer to protect output from XSS. |
|
|
|
@ -174,17 +141,39 @@ function normalizeLinkText (url: string): string { |
|
|
|
* - __typographer__ - `false`. Set `true` to enable [some language-neutral |
|
|
|
* replacement](https://github.com/markdown-it/markdown-it/blob/master/src/rules_core/replacements.ts) +
|
|
|
|
* quotes beautification (smartquotes). |
|
|
|
* - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement |
|
|
|
* pairs, when typographer enabled and smartquotes on. For example, you can |
|
|
|
* use `'«»„“'` for Russian, `'„“‚‘'` for German, and |
|
|
|
* - __quotes__ - `“”‘’`. Double + single quotes replacement pairs, when |
|
|
|
* typographer enabled and smartquotes on. For example, you can use |
|
|
|
* `'«»„“'` for Russian, `'„“‚‘'` for German, and |
|
|
|
* `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp). |
|
|
|
* - __highlight__ - `null`. Highlighter function for fenced code blocks. |
|
|
|
* Highlighter `function (str, lang)` should return escaped HTML. It can also |
|
|
|
* return empty string if the source was not changed and should be escaped |
|
|
|
* externaly. If result starts with <pre... internal wrapper is skipped. |
|
|
|
* |
|
|
|
* ##### Example |
|
|
|
* @example Basic usage |
|
|
|
* ```javascript
|
|
|
|
* // node.js, "classic" way:
|
|
|
|
* var MarkdownIt = require('markdown-it'), |
|
|
|
* md = new MarkdownIt(); |
|
|
|
* var result = md.render('# markdown-it rulezz!'); |
|
|
|
* |
|
|
|
* // node.js, the same, but with sugar:
|
|
|
|
* var md = require('markdown-it')(); |
|
|
|
* var result = md.render('# markdown-it rulezz!'); |
|
|
|
* |
|
|
|
* // browser without AMD, added to "window" on script load
|
|
|
|
* // Note, there are no dash.
|
|
|
|
* var md = window.markdownit(); |
|
|
|
* var result = md.render('# markdown-it rulezz!'); |
|
|
|
* ``` |
|
|
|
* |
|
|
|
* @example Single line rendering, without paragraph wrap |
|
|
|
* ```javascript
|
|
|
|
* var md = require('markdown-it')(); |
|
|
|
* var result = md.renderInline('__markdown-it__ rulezz!'); |
|
|
|
* ``` |
|
|
|
* |
|
|
|
* @example Presets and options |
|
|
|
* ```javascript
|
|
|
|
* // commonmark mode
|
|
|
|
* var md = require('markdown-it')('commonmark'); |
|
|
|
@ -200,8 +189,7 @@ function normalizeLinkText (url: string): string { |
|
|
|
* }); |
|
|
|
* ``` |
|
|
|
* |
|
|
|
* ##### Syntax highlighting |
|
|
|
* |
|
|
|
* @example Syntax highlighting |
|
|
|
* ```js
|
|
|
|
* var hljs = require('highlight.js') // https://highlightjs.org/
|
|
|
|
* |
|
|
|
@ -218,8 +206,8 @@ function normalizeLinkText (url: string): string { |
|
|
|
* }); |
|
|
|
* ``` |
|
|
|
* |
|
|
|
* Or with full wrapper override (if you need assign class to `<pre>` or `<code>`): |
|
|
|
* |
|
|
|
* @example Full wrapper override |
|
|
|
* If you need assign class to `<pre>` or `<code>`: |
|
|
|
* ```javascript
|
|
|
|
* var hljs = require('highlight.js') // https://highlightjs.org/
|
|
|
|
* |
|
|
|
@ -236,44 +224,37 @@ function normalizeLinkText (url: string): string { |
|
|
|
* } |
|
|
|
* }); |
|
|
|
* ``` |
|
|
|
* |
|
|
|
**/ |
|
|
|
*/ |
|
|
|
class MarkdownIt { |
|
|
|
/** |
|
|
|
* MarkdownIt#inline -> ParserInline |
|
|
|
* |
|
|
|
* Instance of [[ParserInline]]. You may need it to add new rules when |
|
|
|
* writing plugins. For simple rules control use [[MarkdownIt.disable]] and |
|
|
|
* [[MarkdownIt.enable]]. |
|
|
|
**/ |
|
|
|
* Instance of {@link ParserInline}. You may need it to add new rules when |
|
|
|
* writing plugins. For simple rules control use {@link MarkdownIt.disable} |
|
|
|
* and {@link MarkdownIt.enable}. |
|
|
|
*/ |
|
|
|
inline = new ParserInline() |
|
|
|
|
|
|
|
/** |
|
|
|
* MarkdownIt#block -> ParserBlock |
|
|
|
* |
|
|
|
* Instance of [[ParserBlock]]. You may need it to add new rules when |
|
|
|
* writing plugins. For simple rules control use [[MarkdownIt.disable]] and |
|
|
|
* [[MarkdownIt.enable]]. |
|
|
|
**/ |
|
|
|
* Instance of {@link ParserBlock}. You may need it to add new rules when |
|
|
|
* writing plugins. For simple rules control use {@link MarkdownIt.disable} |
|
|
|
* and {@link MarkdownIt.enable}. |
|
|
|
*/ |
|
|
|
block = new ParserBlock() |
|
|
|
|
|
|
|
/** |
|
|
|
* MarkdownIt#core -> ParserCore |
|
|
|
* |
|
|
|
* Instance of [[ParserCore]] chain executor. You may need it to add new rules when |
|
|
|
* writing plugins. For simple rules control use [[MarkdownIt.disable]] and |
|
|
|
* [[MarkdownIt.enable]]. |
|
|
|
**/ |
|
|
|
* Instance of {@link ParserCore} chain executor. You may need it to add new |
|
|
|
* rules when writing plugins. For simple rules control use |
|
|
|
* {@link MarkdownIt.disable} and {@link MarkdownIt.enable}. |
|
|
|
*/ |
|
|
|
core = new ParserCore() |
|
|
|
|
|
|
|
/** |
|
|
|
* MarkdownIt#renderer -> Renderer |
|
|
|
* |
|
|
|
* Instance of [[Renderer]]. Use it to modify output look. Or to add rendering |
|
|
|
* Instance of {@link Renderer}. Use it to modify output look. Or to add rendering |
|
|
|
* rules for new token types, generated by plugins. |
|
|
|
* |
|
|
|
* ##### Example |
|
|
|
* See {@link Renderer} docs and |
|
|
|
* [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts).
|
|
|
|
* |
|
|
|
* @example |
|
|
|
* ```javascript
|
|
|
|
* var md = require('markdown-it')(); |
|
|
|
* |
|
|
|
@ -284,68 +265,55 @@ class MarkdownIt { |
|
|
|
* |
|
|
|
* md.renderer.rules['my_token'] = myToken |
|
|
|
* ``` |
|
|
|
* |
|
|
|
* See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts).
|
|
|
|
**/ |
|
|
|
*/ |
|
|
|
renderer = new Renderer() |
|
|
|
|
|
|
|
/** |
|
|
|
* MarkdownIt#linkify -> LinkifyIt |
|
|
|
* |
|
|
|
* [linkify-it](https://github.com/markdown-it/linkify-it) instance.
|
|
|
|
* Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/src/rules_core/linkify.ts)
|
|
|
|
* rule. |
|
|
|
**/ |
|
|
|
*/ |
|
|
|
linkify = new LinkifyIt() |
|
|
|
|
|
|
|
/** |
|
|
|
* MarkdownIt#validateLink(url) -> Boolean |
|
|
|
* |
|
|
|
* Link validation function. CommonMark allows too much in links. By default |
|
|
|
* we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas |
|
|
|
* except some embedded image types. |
|
|
|
* |
|
|
|
* You can change this behaviour: |
|
|
|
* |
|
|
|
* @example |
|
|
|
* ```javascript
|
|
|
|
* var md = require('markdown-it')(); |
|
|
|
* // enable everything
|
|
|
|
* md.validateLink = function () { return true; } |
|
|
|
* ``` |
|
|
|
**/ |
|
|
|
*/ |
|
|
|
validateLink = validateLink |
|
|
|
|
|
|
|
/** |
|
|
|
* MarkdownIt#normalizeLink(url) -> String |
|
|
|
* |
|
|
|
* Function used to encode link url to a machine-readable format, |
|
|
|
* which includes url-encoding, punycode, etc. |
|
|
|
**/ |
|
|
|
*/ |
|
|
|
normalizeLink = normalizeLink |
|
|
|
|
|
|
|
/** |
|
|
|
* MarkdownIt#normalizeLinkText(url) -> String |
|
|
|
* |
|
|
|
* Function used to decode link url to a human-readable format` |
|
|
|
**/ |
|
|
|
*/ |
|
|
|
normalizeLinkText = normalizeLinkText |
|
|
|
|
|
|
|
// Expose utils & helpers for easy acces from plugins
|
|
|
|
|
|
|
|
/** |
|
|
|
* MarkdownIt#utils -> utils |
|
|
|
* |
|
|
|
* Assorted utility functions, useful to write plugins. See details |
|
|
|
* [here](https://github.com/markdown-it/markdown-it/blob/master/src/common/utils.ts).
|
|
|
|
**/ |
|
|
|
*/ |
|
|
|
utils = utils |
|
|
|
|
|
|
|
/** |
|
|
|
* MarkdownIt#helpers -> helpers |
|
|
|
* |
|
|
|
* Link components parser functions, useful to write plugins. See details |
|
|
|
* [here](https://github.com/markdown-it/markdown-it/blob/master/src/helpers).
|
|
|
|
**/ |
|
|
|
*/ |
|
|
|
helpers = Object.assign({}, helpers) |
|
|
|
|
|
|
|
declare options: MarkdownItOptions |
|
|
|
@ -367,40 +335,35 @@ class MarkdownIt { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** chainable |
|
|
|
* MarkdownIt.set(options) |
|
|
|
* |
|
|
|
* Set parser options (in the same format as in constructor). Probably, you |
|
|
|
* will never need it, but you can change options after constructor call. |
|
|
|
* |
|
|
|
* ##### Example |
|
|
|
* |
|
|
|
* ```javascript
|
|
|
|
* var md = require('markdown-it')() |
|
|
|
* .set({ html: true, breaks: true }) |
|
|
|
* .set({ typographer: true }); |
|
|
|
* ``` |
|
|
|
* |
|
|
|
* __Note:__ To achieve the best possible performance, don't modify a |
|
|
|
* `markdown-it` instance options on the fly. If you need multiple configurations |
|
|
|
* it's best to create multiple instances and initialize each with separate |
|
|
|
* config. |
|
|
|
**/ |
|
|
|
/** |
|
|
|
* Set parser options (in the same format as in constructor). Probably, you |
|
|
|
* will never need it, but you can change options after constructor call. |
|
|
|
* |
|
|
|
* __Note:__ To achieve the best possible performance, don't modify a |
|
|
|
* `markdown-it` instance options on the fly. If you need multiple configurations |
|
|
|
* it's best to create multiple instances and initialize each with separate |
|
|
|
* config. |
|
|
|
* |
|
|
|
* @example |
|
|
|
* ```javascript
|
|
|
|
* var md = require('markdown-it')() |
|
|
|
* .set({ html: true, breaks: true }) |
|
|
|
* .set({ typographer: true }); |
|
|
|
* ``` |
|
|
|
*/ |
|
|
|
set (options: Partial<MarkdownItOptions>): this { |
|
|
|
Object.assign(this.options, options) |
|
|
|
return this |
|
|
|
} |
|
|
|
|
|
|
|
/** chainable, internal |
|
|
|
* MarkdownIt.configure(presets) |
|
|
|
* |
|
|
|
* Batch load of all options and compenent settings. This is internal method, |
|
|
|
* and you probably will not need it. But if you will - see available presets |
|
|
|
* and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/src/presets)
|
|
|
|
* |
|
|
|
* We strongly recommend to use presets instead of direct config loads. That |
|
|
|
* will give better compatibility with next versions. |
|
|
|
**/ |
|
|
|
/** |
|
|
|
* Batch load of all options and compenent settings. This is internal method, |
|
|
|
* and you probably will not need it. But if you will - see available presets |
|
|
|
* and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/src/presets)
|
|
|
|
* |
|
|
|
* We strongly recommend to use presets instead of direct config loads. That |
|
|
|
* will give better compatibility with next versions. |
|
|
|
*/ |
|
|
|
configure (presets: MarkdownItPresetName | MarkdownItPreset): this { |
|
|
|
let p: MarkdownItPreset |
|
|
|
|
|
|
|
@ -434,23 +397,21 @@ class MarkdownIt { |
|
|
|
return this |
|
|
|
} |
|
|
|
|
|
|
|
/** chainable |
|
|
|
* MarkdownIt.enable(list, ignoreInvalid) |
|
|
|
* - list (String|Array): rule name or list of rule names to enable |
|
|
|
* - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. |
|
|
|
* |
|
|
|
* Enable list or rules. It will automatically find appropriate components, |
|
|
|
* containing rules with given names. If rule not found, and `ignoreInvalid` |
|
|
|
* not set - throws exception. |
|
|
|
* |
|
|
|
* ##### Example |
|
|
|
* |
|
|
|
* ```javascript
|
|
|
|
* var md = require('markdown-it')() |
|
|
|
* .enable(['sub', 'sup']) |
|
|
|
* .disable('smartquotes'); |
|
|
|
* ``` |
|
|
|
**/ |
|
|
|
/** |
|
|
|
* Enable list or rules. It will automatically find appropriate components, |
|
|
|
* containing rules with given names. If rule not found, and `ignoreInvalid` |
|
|
|
* not set - throws exception. |
|
|
|
* |
|
|
|
* @param list Rule name or list of rule names to enable. |
|
|
|
* @param ignoreInvalid Set `true` to ignore errors when rule not found. |
|
|
|
* |
|
|
|
* @example |
|
|
|
* ```javascript
|
|
|
|
* var md = require('markdown-it')() |
|
|
|
* .enable(['sub', 'sup']) |
|
|
|
* .disable('smartquotes'); |
|
|
|
* ``` |
|
|
|
*/ |
|
|
|
enable (list: string | string[], ignoreInvalid = false): this { |
|
|
|
let result: string[] = [] |
|
|
|
|
|
|
|
@ -472,13 +433,12 @@ class MarkdownIt { |
|
|
|
return this |
|
|
|
} |
|
|
|
|
|
|
|
/** chainable |
|
|
|
* MarkdownIt.disable(list, ignoreInvalid) |
|
|
|
* - list (String|Array): rule name or list of rule names to disable. |
|
|
|
* - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. |
|
|
|
* |
|
|
|
* The same as [[MarkdownIt.enable]], but turn specified rules off. |
|
|
|
**/ |
|
|
|
/** |
|
|
|
* The same as {@link MarkdownIt.enable}, but turn specified rules off. |
|
|
|
* |
|
|
|
* @param list Rule name or list of rule names to disable. |
|
|
|
* @param ignoreInvalid Set `true` to ignore errors when rule not found. |
|
|
|
*/ |
|
|
|
disable (list: string | string[], ignoreInvalid = false): this { |
|
|
|
let result: string[] = [] |
|
|
|
|
|
|
|
@ -499,22 +459,19 @@ class MarkdownIt { |
|
|
|
return this |
|
|
|
} |
|
|
|
|
|
|
|
/** chainable |
|
|
|
* MarkdownIt.use(plugin, params) |
|
|
|
* |
|
|
|
* Load specified plugin with given params into current parser instance. |
|
|
|
* It's just a sugar to call `plugin(md, params)` with curring. |
|
|
|
* |
|
|
|
* ##### Example |
|
|
|
* |
|
|
|
* ```javascript
|
|
|
|
* var iterator = require('markdown-it-for-inline'); |
|
|
|
* var md = require('markdown-it')() |
|
|
|
* .use(iterator, 'foo_replace', 'text', function (tokens, idx) { |
|
|
|
* tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar'); |
|
|
|
* }); |
|
|
|
* ``` |
|
|
|
**/ |
|
|
|
/** |
|
|
|
* Load specified plugin with given params into current parser instance. |
|
|
|
* It's just a sugar to call `plugin(md, params)` with curring. |
|
|
|
* |
|
|
|
* @example |
|
|
|
* ```javascript
|
|
|
|
* var iterator = require('markdown-it-for-inline'); |
|
|
|
* var md = require('markdown-it')() |
|
|
|
* .use(iterator, 'foo_replace', 'text', function (tokens, idx) { |
|
|
|
* tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar'); |
|
|
|
* }); |
|
|
|
* ``` |
|
|
|
*/ |
|
|
|
use<Params extends unknown[]> ( |
|
|
|
plugin: (md: this, ...params: Params) => void, |
|
|
|
...params: Params |
|
|
|
@ -523,21 +480,20 @@ class MarkdownIt { |
|
|
|
return this |
|
|
|
} |
|
|
|
|
|
|
|
/** internal |
|
|
|
* MarkdownIt.parse(src, env) -> Array |
|
|
|
* - src (String): source string |
|
|
|
* - env (Object): environment sandbox |
|
|
|
* |
|
|
|
* Parse input string and return list of block tokens (special token type |
|
|
|
* "inline" will contain list of inline tokens). You should not call this |
|
|
|
* method directly, until you write custom renderer (for example, to produce |
|
|
|
* AST). |
|
|
|
* |
|
|
|
* `env` is used to pass data between "distributed" rules and return additional |
|
|
|
* metadata like reference info, needed for the renderer. It also can be used to |
|
|
|
* inject data in specific cases. Usually, you will be ok to pass `{}`, |
|
|
|
* and then pass updated object to renderer. |
|
|
|
**/ |
|
|
|
/** |
|
|
|
* Parse input string and return list of block tokens (special token type |
|
|
|
* "inline" will contain list of inline tokens). You should not call this |
|
|
|
* method directly, until you write custom renderer (for example, to produce |
|
|
|
* AST). |
|
|
|
* |
|
|
|
* `env` is used to pass data between "distributed" rules and return additional |
|
|
|
* metadata like reference info, needed for the renderer. It also can be used to |
|
|
|
* inject data in specific cases. Usually, you will be ok to pass `{}`, |
|
|
|
* and then pass updated object to renderer. |
|
|
|
* |
|
|
|
* @param src Source string. |
|
|
|
* @param env Environment sandbox. |
|
|
|
*/ |
|
|
|
parse (src: string, env: Env): Token[] { |
|
|
|
if (typeof src !== 'string') { |
|
|
|
throw new Error('Input data should be a String') |
|
|
|
@ -551,29 +507,27 @@ class MarkdownIt { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* MarkdownIt.render(src [, env]) -> String |
|
|
|
* - src (String): source string |
|
|
|
* - env (Object): environment sandbox |
|
|
|
* |
|
|
|
* Render markdown string into html. It does all magic for you :). |
|
|
|
* |
|
|
|
* `env` can be used to inject additional metadata (`{}` by default). |
|
|
|
* But you will not need it with high probability. See also comment |
|
|
|
* in [[MarkdownIt.parse]]. |
|
|
|
**/ |
|
|
|
* Render markdown string into html. It does all magic for you :). |
|
|
|
* |
|
|
|
* `env` can be used to inject additional metadata (`{}` by default). |
|
|
|
* But you will not need it with high probability. See also comment |
|
|
|
* in {@link MarkdownIt.parse}. |
|
|
|
* |
|
|
|
* @param src Source string. |
|
|
|
* @param env Environment sandbox. |
|
|
|
*/ |
|
|
|
render (src: string, env: Env = {}): string { |
|
|
|
return this.renderer.render(this.parse(src, env), this.options, env) |
|
|
|
} |
|
|
|
|
|
|
|
/** internal |
|
|
|
* MarkdownIt.parseInline(src, env) -> Array |
|
|
|
* - src (String): source string |
|
|
|
* - env (Object): environment sandbox |
|
|
|
* |
|
|
|
* The same as [[MarkdownIt.parse]] but skip all block rules. It returns the |
|
|
|
* block tokens list with the single `inline` element, containing parsed inline |
|
|
|
* tokens in `children` property. Also updates `env` object. |
|
|
|
**/ |
|
|
|
/** |
|
|
|
* The same as {@link MarkdownIt.parse} but skip all block rules. It returns |
|
|
|
* the block tokens list with the single `inline` element, containing parsed |
|
|
|
* inline tokens in `children` property. Also updates `env` object. |
|
|
|
* |
|
|
|
* @param src Source string. |
|
|
|
* @param env Environment sandbox. |
|
|
|
*/ |
|
|
|
parseInline (src: string, env: Env): Token[] { |
|
|
|
const state = new this.core.State(src, this, env) |
|
|
|
|
|
|
|
@ -584,13 +538,12 @@ class MarkdownIt { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* MarkdownIt.renderInline(src [, env]) -> String |
|
|
|
* - src (String): source string |
|
|
|
* - env (Object): environment sandbox |
|
|
|
* |
|
|
|
* Similar to [[MarkdownIt.render]] but for single paragraph content. Result |
|
|
|
* will NOT be wrapped into `<p>` tags. |
|
|
|
**/ |
|
|
|
* Similar to {@link MarkdownIt.render} but for single paragraph content. |
|
|
|
* Result will NOT be wrapped into `<p>` tags. |
|
|
|
* |
|
|
|
* @param src Source string. |
|
|
|
* @param env Environment sandbox. |
|
|
|
*/ |
|
|
|
renderInline (src: string, env: Env = {}): string { |
|
|
|
return this.renderer.render(this.parseInline(src, env), this.options, env) |
|
|
|
} |
|
|
|
|