@@ -84,7 +84,8 @@ import Text.Pandoc.PDF (makePDF)
8484import Text.Pandoc.Process (pipeProcess)
8585import Text.Pandoc.SelfContained (makeDataURI, makeSelfContained)
8686import Text.Pandoc.Shared (headerShift, isURI, openURL, readDataFile,
87− readDataFileUTF8, safeRead, tabFilter)
87+ readDataFileUTF8, safeRead, tabFilter,
88+ eastAsianLineBreakFilter)
8889import qualified Text.Pandoc.UTF8 as UTF8
8990import Text.Pandoc.XML (toEntities)
9091import Text.Printf
@@ -381,9 +382,17 @@ convertWithOpts opts = do
381382 "Specify an output file using the -o option."
382383
383384
384− let transforms = case optBaseHeaderLevel opts of
385− x | x > 1 -> [headerShift (x - 1)]
386− | otherwise -> []
385+ let transforms = (case optBaseHeaderLevel opts of
386+ x | x > 1 -> (headerShift (x - 1) :)
387+ | otherwise -> id) $
388+ (if extensionEnabled Ext_east_asian_line_breaks
389+ readerExts &&
390+ not (extensionEnabled Ext_east_asian_line_breaks
391+ writerExts &&
392+ writerWrapText writerOptions == WrapPreserve)
393+ then (eastAsianLineBreakFilter :)
394+ else id)
395+ []
387396
388397 let convertTabs = tabFilter (if optPreserveTabs opts || readerName == "t2t"
389398 then 0