File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,13 @@ Paths are relative to project base.
216216
217217Supports fast-glob: https://github.com/mrmlnc/fast-glob#pattern-syntax
218218
219+ #### url_rewrite
220+
221+ A callback where Markdown generated URLs can be rewritten.
222+ Function is called the original URL and returns the (modified) URL.
223+
224+ Example: ` url_rewrite: (url) => { return url + '.foo' } `
225+
219226#### watch_paths
220227
221228An array of file patterns to watch to refresh data loaders in dev mode.
Original file line number Diff line number Diff line change @@ -435,8 +435,14 @@ function dovecot_markdown(md, opts) {
435435 }
436436
437437 function resolveURL ( url ) {
438- return ( opts . base . endsWith ( '/' ) ? opts . base . slice ( 0 , - 1 ) : opts . base ) +
438+ if ( ! ( 'url_rewrite' in opts ) ) {
439+ opts . url_rewrite = dovecotSetting ( 'url_rewrite' )
440+ }
441+
442+ const url =
443+ ( opts . base . endsWith ( '/' ) ? opts . base . slice ( 0 , - 1 ) : opts . base ) +
439444 '/' + url
445+ return ( opts . url_rewrite ) ? opts . url_rewrite ( url ) : url
440446 }
441447
442448 md . inline . ruler . after ( 'emphasis' , 'dovecot_brackets' , process_brackets )
You can’t perform that action at this time.
0 commit comments