git.iko.soy/typeable/pandoc
on master help sign in
RST reader: seek include files in the directory...
2a2e08dJohn MacFarlane
src/Text/Pandoc/Readers/RST.hs+3−1
@@ -38,6 +38,7 @@ import Text.Pandoc.Parsing
38import Text.Pandoc.Shared
38import Text.Pandoc.Shared
39import qualified Text.Pandoc.UTF8 as UTF8
39import qualified Text.Pandoc.UTF8 as UTF8
40import Data.Time.Format
40import Data.Time.Format
41+import System.FilePath (takeDirectory)
41
42
42-- TODO:
43-- TODO:
43-- [ ] .. parsed-literal
44-- [ ] .. parsed-literal
@@ -483,7 +484,8 @@ includeDirective top fields body = do
483 Nothing -> id)
484 Nothing -> id)
484 let toStream t =
485 let toStream t =
485 toSources [(f, T.unlines . selectLines . T.lines $ t)]
486 toSources [(f, T.unlines . selectLines . T.lines $ t)]
487+ currentDir <- takeDirectory . sourceName <$> getPosition
486− insertIncludedFile parser toStream ["."] f startLine endLine
488+ insertIncludedFile parser toStream [currentDir] f startLine endLine
487
489
488--
490--
489-- list blocks
491-- list blocks