Skip to content

stripHeadingForLink

Official

Prepares headings for linking by stripping out some bad combinations of special characters that could break links.

Import:

import { stripHeadingForLink } from 'obsidian';

Example:

console.log(stripHeadingForLink('foo:#|^\\\r\n%%[[]]bar')); // foo bar

Signature:

function stripHeadingForLink(heading: string): string

Parameters:

ParameterTypeDescription
headingstringThe heading to prepare.

Returns: string — The prepared heading.

Example:

console.log(stripHeadingForLink('foo:#|^\\\r\n%%[[]]bar')); // foo bar