TurndownServiceRules
Unofficial
Collection of rules used by TurndownService for HTML-to-Markdown conversion.
Import:
import type { TurndownServiceRules } from '@obsidian-typings/obsidian-public-latest';Signature:
export interface TurndownServiceRulesProperties
| Property | Type | Description | |
|---|---|---|---|
| array | TurndownServiceRule[] | Array of registered rules. | |
| blankRule | TurndownServiceReplacementFunction | Replacement function for blank nodes. | |
| defaultRule | TurndownServiceReplacementFunction | Default replacement function when no rule matches. | |
| keepReplacement | TurndownServiceReplacementFunction | Replacement function for kept elements. | |
| options | TurndownServiceOptions | Current rule options. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| add(key, rule) | void | Add a rule. | |
| forEach(callback) | void | Iterate over all rules. | |
| forNode(node) | TurndownServiceRule | Find the matching rule for a node. | |
| keep(filter) | void | Keep elements matching a filter (pass through as HTML). | |
| remove(filter) | void | Remove elements matching a filter from output. |