Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
Custom URL Parsers
This document describes the custom URL parsing functionality added to the unfurl service to handle special cases where document titles are embedded in the URL structure rather than available in HTML metadata, and to support embeddable content (video players, etc.).
Supported Services
Title Parsing
Notion
- Pattern:
notion.so/[workspace]/[title-with-dashes]-[uuid]ornotion.so/[title-with-dashes]-[uuid] - Examples:
https://www.notion.so/macrocom/Enterprise-Product-Bottlenecks-5acb869109a747c1a1a92bbf1891ff2d→ "Enterprise Product Bottlenecks"https://www.notion.so/Macro-Work-Thoughts-e52b32630b2e45fab665b3e5c566cf3b→ "Macro Work Thoughts"https://www.notion.so/craft-ventures/Craft-Ventures-Operating-Playbooks-9db7bdccfc0f47be96076c122513691c→ "Craft Ventures Operating Playbooks"
- Fallback: Returns "Notion" if URL parsing fails
Figma
- Pattern:
figma.com/design/[file-id]/[title-with-dashes]?... - Examples:
https://www.figma.com/design/Kf1Vep5riU3re2GO4E0q6b/Peter-Copy-of-Paper-Crowns?node-id=0-1&p=f&t=Z2dZh8AyxauKitCl-0→ "Peter Copy Of Paper Crowns"https://www.figma.com/design/VWgAP7zMauuWKkeS3CmWk3/AI-side-panel?node-id=0-1&p=f&t=SqdP6D2w2rZ5iSjV-0→ "AI Side Panel"
- Fallback: Returns "Figma" if URL parsing fails
Linear
- Pattern:
linear.app/[team]/issue/[ticket-id]/[title-with-dashes] - Examples:
https://linear.app/macro-eng/issue/M-3586/ability-to-archive-emails→ "Ability To Archive Emails"https://linear.app/macro-eng/issue/M-3421/add-macro-permissions-to-jwt-token→ "Add Macro Permissions To Jwt Token"
- Fallback: Returns "Linear" if URL parsing fails
Video Embed Support
The unfurl service also supports embeddable video content for services like Loom and Supercut. When a share URL is detected, the response includes embed_type: "Video" and an embed_url that can be used in an iframe.
Supercut
- Share URL Pattern:
supercut.ai/share/[workspace]/[video-id] - Embed URL:
supercut.ai/embed/[workspace]/[video-id] - Examples:
https://supercut.ai/share/onsteroids/zvAqfSVFnB7vUh71Sfqhq4→ embed:https://supercut.ai/embed/onsteroids/zvAqfSVFnB7vUh71Sfqhq4
- Title Fallback: Returns "Supercut" if URL parsing fails
Loom
- Share URL Pattern:
loom.com/share/[video-id]orwww.loom.com/share/[video-id] - Embed URL:
www.loom.com/embed/[video-id] - Examples:
https://www.loom.com/share/e5b8c04bca094dd8a5507925ab887002→ embed:https://www.loom.com/embed/e5b8c04bca094dd8a5507925ab887002
- Title Fallback: Returns "Loom" if URL parsing fails
Frontend Rendering
When the frontend receives an unfurl response with embed_type: "Video" and embed_url, it renders an embedded video player using an iframe instead of a standard link preview card. The video player is shown on hover in the LinkHoverCard component.
Implementation Details
Files Added/Modified
src/unfurl/url_parsers.rs(new): Contains the custom parsing logic for each servicesrc/unfurl/mod.rs: Updated to include the new url_parsers modulesrc/unfurl/unfurl.rs: ModifiedGetUnfurlResponse::get_title()to try custom parsing first before falling back to metadatasrc/bin/test_parsers.rs(new): Standalone test binary to validate parser functionalitydata/lots_of_links.json: Added test URLs for the new services
How It Works
- When
GetUnfurlResponse::get_title()is called, it first attempts custom URL parsing usingparse_custom_title() - If custom parsing succeeds, it returns the parsed title
- If custom parsing fails or returns
None, it falls back to the original metadata extraction logic - For supported services that can't be parsed (e.g., homepage URLs), it returns the service name as fallback
Function Hierarchy
GetUnfurlResponse::new()
├── get_title() → title string
│ ├── parse_custom_title()
│ │ ├── parse_notion_title() → Some("Parsed Title") | None
│ │ ├── parse_figma_title() → Some("Parsed Title") | None
│ │ ├── parse_linear_title() → Some("Parsed Title") | None
│ │ └── Fallback to service name (e.g., "Notion", "Figma", "Linear", "Supercut", "Loom")
│ └── Original metadata extraction (if custom parsing returns None)
└── parse_embed_info() → embed_type, embed_url
├── parse_supercut_embed() → Some(EmbedInfo) | None
└── parse_loom_embed() → Some(EmbedInfo) | None
Testing
Running Tests
Due to workspace Cargo issues with edition2024, the tests may not run directly. However, the functionality can be tested manually:
- Unit Tests: Added comprehensive tests in
src/unfurl/unfurl.rsfor all three services - Integration Tests: Added tests that verify the integration with
GetUnfurlResponse::get_title() - Standalone Test Binary:
src/bin/test_parsers.rsprovides a way to test parsers independently
Manual Testing
You can test the service manually by starting it and making requests:
# Start the service
just run
# Test Notion URL
curl 'http://localhost:8080/unfurl?url=https://www.notion.so/macrocom/Enterprise-Product-Bottlenecks-5acb869109a747c1a1a92bbf1891ff2d'
# Test Figma URL
curl 'http://localhost:8080/unfurl?url=https://www.figma.com/design/Kf1Vep5riU3re2GO4E0q6b/Peter-Copy-of-Paper-Crowns?node-id=0-1&p=f&t=Z2dZh8AyxauKitCl-0'
# Test Linear URL
curl 'http://localhost:8080/unfurl?url=https://linear.app/macro-eng/issue/M-3586/ability-to-archive-emails'
# Test Supercut URL (returns embed_type and embed_url)
curl 'http://localhost:8080/unfurl?url=https://supercut.ai/share/onsteroids/zvAqfSVFnB7vUh71Sfqhq4'
# Test Loom URL (returns embed_type and embed_url)
curl 'http://localhost:8080/unfurl?url=https://www.loom.com/share/e5b8c04bca094dd8a5507925ab887002'
# Test bulk processing
just bulk-link-test
Future Considerations
- URL Format Changes: These companies may change their URL formats in the future. The parsers are designed to be simple and focused on current patterns.
- Additional Services: The architecture supports adding more custom parsers by extending the
parse_custom_title()function. - Performance: Custom parsing happens before web requests, so it's faster for supported URLs.
- Fallback Strategy: All parsers include graceful fallbacks to ensure the service remains functional even if parsing logic breaks.
Error Handling
- Invalid URLs return
Noneand fall back to metadata extraction - Malformed URLs for supported services return the service name as fallback
- Non-supported URLs are ignored and processed normally
- All parsing is done safely with proper error handling