Skip to content

Commit 1d75ab8

Browse files
authored
Fix to correctly parse Obsidian-style ![[img]], skip internal text formatting (#291)
1 parent 3273a70 commit 1d75ab8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

autocorrect/grammar/markdown.pest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ meta_tags_val = @{ meta_tags_item ~ meta_tags_divider }
9494
meta_tags_item = { (!(newline | ",") ~ (CJK | " " | ASCII_ALPHANUMERIC))* }
9595
meta_tags_divider = { " "* ~ "," ~ " "* }
9696
image_prefix = @{ "!" }
97-
img = ${ image_prefix ~ link }
97+
img = ${ image_prefix ~ (wikilinks | link) }
9898

9999
/// Matches link, e.g.: `[Hello](/hello)` or `[Hello]`
100100
link = ${ link_string_wrap ~ href? }

autocorrect/src/code/markdown.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ mod tests {
155155
- [link链接](https://google.com/a/b/url不处理)
156156
- Escher puzzle([链接](https://google.com))
157157
- 一个[[Wikilinks测试]]示例
158+
- 一个![[obsidian style img测试.png]]示例
158159
159160
请记住:对该仓库的贡献,应遵循我们的GitHub社区准则。
160161
@@ -295,6 +296,7 @@ mod tests {
295296
- [link 链接](https://google.com/a/b/url不处理)
296297
- Escher puzzle([链接](https://google.com))
297298
- 一个[[Wikilinks测试]]示例
299+
- 一个![[obsidian style img测试.png]]示例
298300
299301
请记住:对该仓库的贡献,应遵循我们的 GitHub 社区准则。
300302

0 commit comments

Comments
 (0)