Skip to content

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 TurndownServiceRules

Properties

PropertyTypeDescription
arrayTurndownServiceRule[]Array of registered rules.
blankRuleTurndownServiceReplacementFunctionReplacement function for blank nodes.
defaultRuleTurndownServiceReplacementFunctionDefault replacement function when no rule matches.
keepReplacementTurndownServiceReplacementFunctionReplacement function for kept elements.
optionsTurndownServiceOptionsCurrent rule options.

Methods

MethodReturnsDescription
add(key, rule)voidAdd a rule.
forEach(callback)voidIterate over all rules.
forNode(node)TurndownServiceRuleFind the matching rule for a node.
keep(filter)voidKeep elements matching a filter (pass through as HTML).
remove(filter)voidRemove elements matching a filter from output.