autolinkBareUrls
Wraps any bare http(s):// URL in the given text in angle brackets (<url>) so that text emitted into a Markdown document (such as a generated changelog bullet) passes markdownlint’s MD034/no-bare-urls rule while still rendering as a clickable autolink on GitHub.
URLs that are already wrapped in angle brackets (<url>) or that form the target of a Markdown link ([text](url)) are left untouched, so the function is safe to run repeatedly. Trailing sentence punctuation (., ,, ;, :, !, ?) is kept outside the angle brackets so it does not become part of the link.
Import:
import { autolinkBareUrls } from 'obsidian-dev-utils/script-utils/version';Signature:
function autolinkBareUrls(text: string): stringParameters:
| Parameter | Type | Description |
|---|---|---|
text | string | The text possibly containing bare URLs. |
Returns: string — The text with every bare URL wrapped in angle brackets.