renderer.renderInline
How to read this API
These are TypeScript APIs compiled into SnapTeX; a .tex project cannot load them at runtime.
function name(...)is a helper that your rule imports and calls.apply(...),render(...),extract(...), andcollect(...)are callbacks that your rule implements and SnapTeX calls.renderer.name(...),context.name(...),input.name(...), anddeps.name(...)are methods SnapTeX supplies to callbacks; do not import or construct them.service.name(...)is an instance method called after your host or test constructsPreviewUpdateService.
Register extension declarations through SNAP_TEX_RULES in src/rules.ts. See Source API Scope for imports, value ownership, output safety, rebuilds, and testing.
Runs the configured Markdown-it inline renderer on a text fragment. Use it for Markdown-compatible inline text after any LaTeX-specific transformation has already happened.
Signature
ts
renderer.renderInline(text: string): stringParameters
| Parameter | Description |
|---|---|
text | Inline Markdown-compatible text |
Returns
Rendered inline HTML. If the Markdown engine is unavailable, the implementation returns the input text.
Call relationships
- Called by: legacy rules after their LaTeX-specific transformations.
- Calls:
MarkdownIt.renderInline. - Often paired with:
protectHtmlwhen the result is inserted into the outer legacy pipeline.
ts
const html = renderer.renderInline('A *short* description');
return renderer.protectHtml('description', html, 'inline');This function handles Markdown, not arbitrary LaTeX. Use renderInlineLatexHtml when the fragment contains supported LaTeX styles or inline math.