Skip to content

Commit

Permalink
RST reader: seek include files in the directory...
Browse files Browse the repository at this point in the history
...of the file containing the include directive, as
RST requires.

Closes #6632.
  • Loading branch information
jgm committed May 10, 2021
1 parent b2398cd commit 2a2e08d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Text/Pandoc/Readers/RST.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import Text.Pandoc.Parsing
import Text.Pandoc.Shared
import qualified Text.Pandoc.UTF8 as UTF8
import Data.Time.Format
import System.FilePath (takeDirectory)

-- TODO:
-- [ ] .. parsed-literal
Expand Down Expand Up @@ -483,7 +484,8 @@ includeDirective top fields body = do
Nothing -> id)
let toStream t =
toSources [(f, T.unlines . selectLines . T.lines $ t)]
insertIncludedFile parser toStream ["."] f startLine endLine
currentDir <- takeDirectory . sourceName <$> getPosition
insertIncludedFile parser toStream [currentDir] f startLine endLine

--
-- list blocks
Expand Down

0 comments on commit 2a2e08d

Please sign in to comment.