@@ -55,10 +55,7 @@ writeCommonMark opts (Pandoc meta blocks) = do
5555 notes' = if null notes
5656 then []
5757 else [OrderedList (1, Decimal, Period) $ reverse notes]
58− let blocks'' = if writerWrapText opts == WrapNone
59− then walk softBreakToSpace blocks'
60− else blocks'
61− main <- blocksToCommonMark opts (blocks'' ++ notes')
58+ main <- blocksToCommonMark opts (blocks' ++ notes')
6259 metadata <- metaToJSON opts
6360 (blocksToCommonMark opts)
6461 (inlinesToCommonMark opts)
@@ -232,10 +229,16 @@ inlinesToNodes :: WriterOptions -> [Inline] -> [Node]
232229inlinesToNodes opts = foldr (inlineToNodes opts) []
233230
234231inlineToNodes :: WriterOptions -> Inline -> [Node] -> [Node]
235−inlineToNodes _ (Str s) = (node (TEXT (T.pack s)) [] :)
232+inlineToNodes opts (Str s) = (node (TEXT (T.pack s')) [] :)
233+ where s' = if isEnabled Ext_smart opts
234+ then unsmartify opts s
235+ else s
236236inlineToNodes _ Space = (node (TEXT (T.pack " ")) [] :)
237237inlineToNodes _ LineBreak = (node LINEBREAK [] :)
238−inlineToNodes _ SoftBreak = (node SOFTBREAK [] :)
238+inlineToNodes opts SoftBreak
239+ | isEnabled Ext_hard_line_breaks opts = (node LINEBREAK [] :)
240+ | writerWrapText opts == WrapNone = (node (TEXT " ") [] :)
241+ | otherwise = (node SOFTBREAK [] :)
239242inlineToNodes opts (Emph xs) = (node EMPH (inlinesToNodes opts xs) :)
240243inlineToNodes opts (Strong xs) = (node STRONG (inlinesToNodes opts xs) :)
241244inlineToNodes opts (Strikeout xs) =
@@ -264,8 +267,12 @@ inlineToNodes opts (Quoted qt ils) =
264267 ((node (TEXT start) [] :
265268 inlinesToNodes opts ils ++ [node (TEXT end) []]) ++)
266269 where (start, end) = case qt of
267− SingleQuote -> (T.pack "‘", T.pack "’")
268− DoubleQuote -> (T.pack "“", T.pack "”")
270+ SingleQuote
271+ | isEnabled Ext_smart opts -> ("'","'")
272+ | otherwise -> ("‘", "’")
273+ DoubleQuote
274+ | isEnabled Ext_smart opts -> ("\"", "\"")
275+ | otherwise -> ("“", "”")
269276inlineToNodes _ (Code _ str) = (node (CODE (T.pack str)) [] :)
270277inlineToNodes _ (Math mt str) =
271278 case mt of