Auto Links

by devxoul
5
4
3
2
1
Score: 35/100

Description

This plugin has not been manually reviewed by Obsidian staff. Auto-convert regex patterns to clickable links.

Reviews

No reviews yet.

Stats

stars
downloads
0
forks
1
days
NaN
days
NaN
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
0
commits

Latest Version

Invalid date

Changelog

README file from

Github

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

Editor Options
Editor Options

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

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

Pattern URL Template Input Output Link
ISSUE-(\d+) https://github.com/myorg/myrepo/issues/$1 ISSUE-123 https://github.com/myorg/myrepo/issues/123
(ABC|DEF)-(\d+) https://notion.so/myteam/$1-$2 ABC-123 https://notion.so/myteam/ABC-123
\$([A-Z]{3}) https://finance.yahoo.com/quote/$1 $AAPL https://finance.yahoo.com/quote/AAPL
PR#(\d+) https://github.com/myorg/myrepo/pull/$1 PR#456 https://github.com/myorg/myrepo/pull/456
@([a-zA-Z0-9_]+) https://twitter.com/$1 @username https://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
  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