File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ impl IgnoreBlocks {
27
27
Event :: Start ( Tag :: CodeBlock ( _) ) => {
28
28
ignore_till_end ! ( TagEnd :: CodeBlock ) ;
29
29
}
30
+ Event :: Start ( Tag :: Link { .. } ) => {
31
+ ignore_till_end ! ( TagEnd :: Link { .. } ) ;
32
+ }
33
+ Event :: Start ( Tag :: Image { .. } ) => {
34
+ ignore_till_end ! ( TagEnd :: Image { .. } ) ;
35
+ }
30
36
Event :: Start ( Tag :: BlockQuote ( _) ) => {
31
37
let start = range. start ;
32
38
let mut count = 1 ;
@@ -324,11 +330,22 @@ fn cbs_13() {
324
330
325
331
#[ test]
326
332
fn ignore_link ( ) {
327
- assert_eq ! ( bodies( "[This is a link](https://example.com)" ) , [ ] ) ;
328
- assert_eq ! ( bodies( "" ) , [ ] ) ;
333
+ assert_eq ! (
334
+ bodies( "[This is a link](https://example.com)" ) ,
335
+ [ Ignore :: Yes ( "[This is a link](https://example.com)" ) ]
336
+ ) ;
337
+ assert_eq ! (
338
+ bodies( "" ) ,
339
+ [ Ignore :: Yes ( "" ) ]
340
+ ) ;
329
341
342
+ // Unfortunately pulldown_cmark does not give ranges for the link
343
+ // definition.
330
344
assert_eq ! (
331
345
bodies( "[Link from def]\n \n [Link from def]: https://example.com" ) ,
332
- [ ]
346
+ [
347
+ Ignore :: Yes ( "[Link from def]" ) ,
348
+ Ignore :: No ( "\n \n [Link from def]: https://example.com" )
349
+ ]
333
350
) ;
334
351
}
You can’t perform that action at this time.
0 commit comments