@@ -8,22 +8,14 @@ export interface AssetsPluginOptions {
8
8
* Whether to prepend base to absolute path
9
9
*/
10
10
absolutePathPrependBase ?: boolean
11
-
12
- /**
13
- * Prefix to add to relative assets links
14
- */
15
- relativePathPrefix ?: string
16
11
}
17
12
18
13
/**
19
14
* Plugin to handle assets links
20
15
*/
21
16
export const assetsPlugin : PluginWithOptions < AssetsPluginOptions > = (
22
17
md ,
23
- {
24
- absolutePathPrependBase = false ,
25
- relativePathPrefix = '@source' ,
26
- } : AssetsPluginOptions = { } ,
18
+ { absolutePathPrependBase = false } : AssetsPluginOptions = { } ,
27
19
) => {
28
20
// wrap raw image renderer rule
29
21
const rawImageRule = md . renderer . rules . image !
@@ -35,10 +27,7 @@ export const assetsPlugin: PluginWithOptions<AssetsPluginOptions> = (
35
27
36
28
if ( link ) {
37
29
// replace the original link with resolved link
38
- token . attrSet (
39
- 'src' ,
40
- resolveLink ( link , { env, absolutePathPrependBase, relativePathPrefix } ) ,
41
- )
30
+ token . attrSet ( 'src' , resolveLink ( link , { env, absolutePathPrependBase } ) )
42
31
}
43
32
44
33
return rawImageRule ( tokens , idx , options , env , self )
@@ -57,7 +46,6 @@ export const assetsPlugin: PluginWithOptions<AssetsPluginOptions> = (
57
46
`${ prefix } ${ quote } ${ resolveLink ( src . trim ( ) , {
58
47
env,
59
48
absolutePathPrependBase,
60
- relativePathPrefix,
61
49
strict : true ,
62
50
} ) } ${ quote } `,
63
51
)
@@ -74,7 +62,6 @@ export const assetsPlugin: PluginWithOptions<AssetsPluginOptions> = (
74
62
`${ resolveLink ( url . trim ( ) , {
75
63
env,
76
64
absolutePathPrependBase,
77
- relativePathPrefix,
78
65
strict : true ,
79
66
} ) } ${ descriptor . replace ( / [ \n ] + / g, ' ' ) . trimEnd ( ) } `,
80
67
) ,
0 commit comments