diff options
Diffstat (limited to 'src/Text/Pandoc/Writers/LaTeX')
| -rw-r--r-- | src/Text/Pandoc/Writers/LaTeX/Types.hs | 3 | ||||
| -rw-r--r-- | src/Text/Pandoc/Writers/LaTeX/Util.hs | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX/Types.hs b/src/Text/Pandoc/Writers/LaTeX/Types.hs index d598794ad..c06b7e923 100644 --- a/src/Text/Pandoc/Writers/LaTeX/Types.hs +++ b/src/Text/Pandoc/Writers/LaTeX/Types.hs @@ -40,7 +40,7 @@ data WriterState = , stCsquotes :: Bool -- ^ true if document uses csquotes , stHighlighting :: Bool -- ^ true if document has highlighted code , stIncremental :: Bool -- ^ true if beamer lists should be - -- displayed bit by bit + , stZwnj :: Bool -- ^ true if document has a ZWNJ character , stInternalLinks :: [Text] -- ^ list of internal link targets , stBeamer :: Bool -- ^ produce beamer , stEmptyLine :: Bool -- ^ true if no content on line @@ -74,6 +74,7 @@ startingState options = , stCsquotes = False , stHighlighting = False , stIncremental = writerIncremental options + , stZwnj = False , stInternalLinks = [] , stBeamer = False , stEmptyLine = True diff --git a/src/Text/Pandoc/Writers/LaTeX/Util.hs b/src/Text/Pandoc/Writers/LaTeX/Util.hs index 56bb792ae..c34338121 100644 --- a/src/Text/Pandoc/Writers/LaTeX/Util.hs +++ b/src/Text/Pandoc/Writers/LaTeX/Util.hs @@ -22,6 +22,7 @@ module Text.Pandoc.Writers.LaTeX.Util ( where import Control.Applicative ((<|>)) +import Control.Monad (when) import Text.Pandoc.Class (PandocMonad, toLang) import Text.Pandoc.Options (WriterOptions(..), isEnabled) import Text.Pandoc.Writers.LaTeX.Types (LW, WriterState(..)) @@ -30,7 +31,7 @@ import Text.Pandoc.Highlighting (toListingsLanguage) import Text.DocLayout import Text.Pandoc.Definition import Text.Pandoc.ImageSize (showFl) -import Control.Monad.State.Strict (gets) +import Control.Monad.State.Strict (gets, modify) import Data.Text (Text) import qualified Data.Text as T import Text.Pandoc.Extensions (Extension(Ext_smart)) @@ -49,6 +50,8 @@ data StringContext = TextString stringToLaTeX :: PandocMonad m => StringContext -> Text -> LW m Text stringToLaTeX context zs = do opts <- gets stOptions + when ('\x200c' `elemText` zs) $ + modify (\s -> s { stZwnj = True }) return $ T.pack $ foldr (go opts context) mempty $ T.unpack $ if writerPreferAscii opts @@ -270,5 +273,3 @@ mbBraced :: Text -> Text mbBraced x = if not (T.all isAlphaNum x) then "{" <> x <> "}" else x - - |
