appendCodeBlock
Appends a code block to the given DocumentFragment or HTMLElement, styled to match Obsidian’s rendered-markdown inline code.
Import:
import { appendCodeBlock } from 'obsidian-dev-utils/obsidian/html-element';Signature:
function appendCodeBlock(el: HTMLElement | DocumentFragment, code: string): voidParameters:
| Parameter | Type | Description |
|---|---|---|
el | HTMLElement | DocumentFragment | The DocumentFragment or HTMLElement to append the code block to. |
code | string | The code to be displayed in the code block. |
Returns: void