diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs index c4d54c06e..9c55d0a7a 100644 --- a/src/Text/Pandoc/Extensions.hs +++ b/src/Text/Pandoc/Extensions.hs @@ -517,6 +517,7 @@ getAllExtensions f = universalExtensions <> getAll f , Ext_attributes , Ext_sourcepos , Ext_yaml_metadata_block + , Ext_rebase_relative_paths ] getAll "commonmark_x" = getAll "commonmark" getAll "org" = autoIdExtensions <> diff --git a/src/Text/Pandoc/Readers/CommonMark.hs b/src/Text/Pandoc/Readers/CommonMark.hs index b099a9b50..228e65312 100644 --- a/src/Text/Pandoc/Readers/CommonMark.hs +++ b/src/Text/Pandoc/Readers/CommonMark.hs @@ -112,5 +112,7 @@ specFor opts = foldr ($) defaultSyntaxSpec exts | isEnabled Ext_implicit_header_references opts ] ++ [ (footnoteSpec <>) | isEnabled Ext_footnotes opts ] ++ [ (definitionListSpec <>) | isEnabled Ext_definition_lists opts ] ++ - [ (taskListSpec <>) | isEnabled Ext_task_lists opts ] + [ (taskListSpec <>) | isEnabled Ext_task_lists opts ] ++ + [ (rebaseRelativePathsSpec <>) + | isEnabled Ext_rebase_relative_paths opts ] diff --git a/test/command/3752.md b/test/command/3752.md index df8af0ba1..2e96b531e 100644 --- a/test/command/3752.md +++ b/test/command/3752.md @@ -42,3 +42,19 @@ A spider: [spider]

Chapter two

A spider: spider

``` + +``` +% pandoc command/chap1/text.md command/chap2/text.md -f commonmark+rebase_relative_paths -t html +^D +

Chapter one

+

A spider: spider

+

Another spider: another spider

+

The moon: moon

+

Link to spider picture.

+

URL left alone: manual.

+

Absolute path left alone: absolute.

+

Link to fragment: chapter two.

+

Empty path: empty.

+

Chapter two

+

A spider: spider

+```