fix: add inline block embeds support to fix #114#119
Conversation
📝 WalkthroughWalkthroughThis PR introduces a new "Inline Block Embeds" feature that allows users to export block references as embedded text content rather than preserved links. A configuration option is added with UI toggle, and embed processing logic is enhanced with helper functions to parse, fetch, and format block content as blockquotes. Changes
Sequence DiagramsequenceDiagram
participant Plugin as Plugin
participant EmbedProc as Embed Processor
participant EmbedMap as EmbedMap
participant Parser as Link Parser
participant FS as File System
participant Formatter as Content Formatter
Plugin->>EmbedProc: Process embed in content
EmbedProc->>EmbedMap: Lookup embed link
alt Found in EmbedMap
EmbedMap-->>EmbedProc: Return mapped content
EmbedProc-->>Plugin: Use mapped content
else Not found & inlineBlockEmbeds enabled
EmbedProc->>Parser: Parse embed link
Parser->>Parser: Extract filePath & blockId
Parser-->>EmbedProc: Resolved path & blockId
EmbedProc->>FS: Fetch block content by ID
rect rgb(230, 245, 255)
FS-->>EmbedProc: Block content retrieved
end
EmbedProc->>Formatter: Format as blockquote
Formatter-->>EmbedProc: "> " prefixed lines
EmbedProc-->>Plugin: Use formatted content
else Not found & setting disabled
EmbedProc-->>Plugin: No replacement
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code graph analysis (1)src/utils.ts (1)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Add new setting "Inline Block Embeds" to replace block refs with content - Fix execution order: process embeds before WikiLinks conversion - Add getBlockContent() to extract block content using Obsidian API - Add parseEmbedLink() to parse file path and block reference ID - Prevent "undefined" output when embed content is not found Fixes #114 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
08bbcd3 to
fe1184c
Compare
Summary
![[#^blockid]]don't work after exportgetBlockContent()to extract block content using Obsidian Metadata APIparseEmbedLink()to parse file path and block reference IDTest plan
![[#^blockid]]are now handled correctlyFixes #114
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.