Auto Links

pending

by Jeon Suyeol

Auto-convert regex patterns to clickable links.

1 starsUpdated 2mo agoMITDiscovered via Obsidian Unofficial Plugins
View on GitHub

Obsidian Auto Links

Auto-convert regex patterns to clickable links in Obsidian, similar to GitHub's autolink feature but with full regex support.

EditorOptions
EditorOptions

Features

  • Regex Pattern Matching: Use full regex patterns with capture groups ($1-$9)
  • Dual Rendering: Works in both Reading View and Live Preview
  • Per-Pattern Toggle: Enable/disable individual patterns
  • Smart Skip Zones: Automatically skips code blocks, inline code, existing links, wikilinks, and frontmatter
  • First-Match-Wins: Prevents overlapping link conflicts
  • Real-time Updates: Changes apply immediately without restart

Installation

From Obsidian Community Plugins (Coming Soon)

This plugin is currently under review for the Obsidian Community Plugins. Once approved, you'll be able to install it directly from:

  1. Open Settings → Community Plugins
  2. Search for "Auto Links"
  3. Click Install, then Enable

Using BRAT (Recommended for Beta Testers)

While the plugin is under review, you can install it using BRAT (Beta Reviewers Auto-update Tool):

  1. Install BRAT from Obsidian Community Plugins
    • Open Settings → Community Plugins → Browse
    • Search for "BRAT"
    • Click Install, then Enable
  2. Add this plugin via BRAT
    • Open Settings → BRAT
    • Click "Add Beta Plugin"
    • Enter: devxoul/obsidian-autolinks
    • Click "Add Plugin"
  3. Enable the plugin
    • Open Settings → Community Plugins
    • Find "Auto Links" and enable it

BRAT will automatically check for updates and keep the plugin up to date.

Manual Installation

  1. Download main.js, manifest.json, and styles.css from the latest release
  2. Create folder <vault>/.obsidian/plugins/autolinks/
  3. Copy the downloaded files into the folder
  4. Reload Obsidian
  5. Enable the plugin in Settings → Community Plugins

Usage

Adding a Pattern

  1. Open Settings → Auto Links
  2. Click "Add new rule"
  3. Enter your regex pattern (e.g., ISSUE-(\d+))
  4. Enter the URL template (e.g., https://github.com/myorg/myrepo/issues/$1)
  5. The pattern is automatically enabled

Pattern Examples

PatternURL TemplateInputOutput Link
ISSUE-(\d+)https://github.com/myorg/myrepo/issues/$1ISSUE-123https://github.com/myorg/myrepo/issues/123
(ABC|DEF)-(\d+)https://notion.so/myteam/$1-$2ABC-123https://notion.so/myteam/ABC-123
\$([A-Z]{3})https://finance.yahoo.com/quote/$1$AAPLhttps://finance.yahoo.com/quote/AAPL
PR#(\d+)https://github.com/myorg/myrepo/pull/$1PR#456https://github.com/myorg/myrepo/pull/456
@([a-zA-Z0-9_]+)https://twitter.com/$1@usernamehttps://twitter.com/username

Capture Groups

Use $1 through $9 in your URL template to reference capture groups from your regex pattern:

Pattern: USER-(\d+)-([A-Z]+)
URL: https://example.com/users/$1/type/$2
Input: USER-123-ADMIN
Output: https://example.com/users/123/type/ADMIN

Skip Zones

Auto Links automatically skips creating links in:

  • Code blocks: ...
  • Inline code: ...
  • Markdown links: text
  • Wikilinks: [[page]]
  • Frontmatter: YAML front matter at the start of files

Example:

Normal text: ISSUE-123 ← becomes a link

Code block:

ISSUE-123 ← NOT a link


Inline code: `ISSUE-123` ← NOT a link

Existing link: [ISSUE-123](http://example.com) ← NOT a link

Wikilink: [[ISSUE-123]] ← NOT a link

Managing Patterns

  • Enable/Disable: Toggle the switch next to each pattern
  • Edit: Click on the pattern or URL field to edit
  • Delete: Click the trash icon to remove a pattern
  • Reorder: Patterns are evaluated in order (first match wins)

Pattern Conflict Resolution

When multiple patterns could match the same text, the first matching pattern wins. This prevents overlapping links.

Example:

Pattern 1: ISSUE-(\d+)
Pattern 2: ISSUE-123

Input: "See ISSUE-123"
Result: Only Pattern 1 matches (Pattern 2 never evaluated for this position)

Regex Tips

Common Patterns

  • Numbers: \d+ (one or more digits)
  • Letters: [A-Za-z]+ (one or more letters)
  • Alphanumeric: [A-Za-z0-9]+
  • Word characters: \w+ (letters, numbers, underscore)
  • Specific characters: [ABC]+ (only A, B, or C)

Escaping Special Characters

If your pattern includes special regex characters, escape them with \:

  • .\.
  • $\$
  • (\(
  • [\[

Testing Patterns

Use regex101.com to test your patterns before adding them to Obsidian.

Troubleshooting

Pattern Not Matching

  1. Check if the pattern is enabled (toggle should be on)
  2. Verify the regex syntax is correct
  3. Check if the text is in a skip zone (code block, inline code, etc.)
  4. Test the pattern on regex101.com

Links Not Appearing

  1. Ensure the plugin is enabled in Settings → Community Plugins
  2. Check browser console for errors (Ctrl+Shift+I / Cmd+Option+I)
  3. Try disabling and re-enabling the plugin
  4. Verify the URL template uses correct capture group syntax ($1, $2, etc.)

Invalid Regex Error

The plugin validates regex patterns when you save. If you see an error:

  1. Check for unmatched brackets: [, ], (, )
  2. Check for unescaped special characters
  3. Verify capture groups are properly formed: (...) not (...

Performance

Auto Links is designed for performance:

  • Reading View: Processes only visible text nodes
  • Live Preview: Uses CodeMirror's syntax tree for efficient skip zone detection
  • Lazy Evaluation: Patterns are only evaluated when text changes
  • First-Match-Wins: Stops evaluation after first match per position

Development

Building from Source

# Install dependencies
bun install

# Development build (watch mode)
bun run dev

# Production build
bun run build

License

MIT

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.