File tree 3 files changed +11
-1
lines changed
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -39,5 +39,9 @@ describe(`Article`, () => {
39
39
`Image 3: ` ,
40
40
) ;
41
41
} ) ;
42
+
43
+ it ( `should NOT rewrite absolute images URLs to match the raw file on github` , ( ) => {
44
+ expect ( articleRead ) . toContain ( `Absolute image: ` ) ;
45
+ } ) ;
42
46
} ) ;
43
47
} ) ;
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ interface ArticleFrontMatter {
7
7
title : string ;
8
8
}
9
9
10
- const imagesRe : RegExp = / \! \[ .* \] \( .* \) / g;
10
+ const imagesRe : RegExp = / \! \[ .* \] \( \. \/ .* \) / g;
11
11
const imageRe : RegExp = / \! \[ ( .* ) \] \( ( [ ^ \) ] * ) (?: ' ( .* ) ' ) ? \) / ;
12
12
13
13
const excludeArticleFromPath = ( path : string ) : string => path . replace ( / \/ [ ^ \/ ] + \. m d $ / , '' ) ;
Original file line number Diff line number Diff line change @@ -9,10 +9,16 @@ canonical_url:
9
9
10
10
# This is my awesome article!
11
11
12
+ ## Relative images
13
+
12
14
Hey, some text!
13
15
14
16
Image 1: ![ alt text 1] ( ./image-1.png ' Title image 1 ')
15
17
16
18
Image 2: ![ alt text 2] ( ./image-2.png ' Title image 2 ')
17
19
18
20
Image 3: ![ alt text 3] ( ./image-3.png )
21
+
22
+ ## Absolute images
23
+
24
+ Absolute image: ![ alt text] ( http://google.com/absolute-image.png )
You can’t perform that action at this time.
0 commit comments