mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
RST reader: seek include files in the directory...
...of the file containing the include directive, as RST requires. Closes #6632.
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user