git.iko.soy/typeable/pandoc
on master help sign in
Man writer: fixed boldfacing of definition terms.

Previously the bold-facing would be interrupted by other formatting, because we used `.B`. Closes #5620.

commitd0bf7efe95f3b2347073549e83496d9dc636594e authorJohn MacFarlane <jgm@berkeley.edu> dateSat 13 Jul 2019, 16:11 (7 years ago) parenta16311c
3 files changed+28−19
src/Text/Pandoc/Writers/Man.hs+2−2 test/command/5620.md+9 test/writer.man+17−17
src/Text/Pandoc/Writers/Man.hs+2−2
@@ -228,7 +228,7 @@ definitionListItemToMan :: PandocMonad m
228228 -> ([Inline],[[Block]])
229229 -> StateT WriterState m Doc
230230definitionListItemToMan opts (label, defs) = do
231− labelText <- inlineListToMan opts label
231+ labelText <- withFontFeature 'B' (inlineListToMan opts label)
232232 contents <- if null defs
233233 then return empty
234234 else liftM vcat $ forM defs $ \blocks ->
@@ -245,7 +245,7 @@ definitionListItemToMan opts (label, defs) = do
245245 then empty
246246 else text ".RS" $$ rest' $$ text ".RE"
247247 [] -> return empty
248− return $ text ".TP" $$ nowrap (text ".B " <> labelText) $$ contents
248+ return $ text ".TP" $$ labelText $$ contents
249249
250250-- | Convert list of Pandoc block elements to man.
251251blockListToMan :: PandocMonad m
test/command/5620.mdnew file+9
@@ -0,0 +1,9 @@
1+```
2+% pandoc -t man
3+`-o`, `--output=`*OUTFILE*
4+: Write output to *OUTFILE* instead of `stdout`(3)
5+^D
6+.TP
7+\f[B]\f[CB]-o\f[B], \f[CB]--output=\f[B]\f[BI]OUTFILE\f[B]\f[R]
8+Write output to \f[I]OUTFILE\f[R] instead of \f[C]stdout\f[R](3)
9+```
test/writer.man+17−17
@@ -318,47 +318,47 @@ Williams
318318.PP
319319Tight using spaces:
320320.TP
321−.B apple
321+\f[B]apple\f[R]
322322red fruit
323323.TP
324−.B orange
324+\f[B]orange\f[R]
325325orange fruit
326326.TP
327−.B banana
327+\f[B]banana\f[R]
328328yellow fruit
329329.PP
330330Tight using tabs:
331331.TP
332−.B apple
332+\f[B]apple\f[R]
333333red fruit
334334.TP
335−.B orange
335+\f[B]orange\f[R]
336336orange fruit
337337.TP
338−.B banana
338+\f[B]banana\f[R]
339339yellow fruit
340340.PP
341341Loose:
342342.TP
343−.B apple
343+\f[B]apple\f[R]
344344red fruit
345345.TP
346−.B orange
346+\f[B]orange\f[R]
347347orange fruit
348348.TP
349−.B banana
349+\f[B]banana\f[R]
350350yellow fruit
351351.PP
352352Multiple blocks with italics:
353353.TP
354−.B \f[I]apple\f[R]
354+\f[B]\f[BI]apple\f[B]\f[R]
355355red fruit
356356.RS
357357.PP
358358contains seeds, crisp, pleasant to taste
359359.RE
360360.TP
361−.B \f[I]orange\f[R]
361+\f[B]\f[BI]orange\f[B]\f[R]
362362orange fruit
363363.RS
364364.IP
@@ -375,31 +375,31 @@ orange block quote
375375.PP
376376Multiple definitions, tight:
377377.TP
378−.B apple
378+\f[B]apple\f[R]
379379red fruit
380380computer
381381.TP
382−.B orange
382+\f[B]orange\f[R]
383383orange fruit
384384bank
385385.PP
386386Multiple definitions, loose:
387387.TP
388−.B apple
388+\f[B]apple\f[R]
389389red fruit
390390computer
391391.TP
392−.B orange
392+\f[B]orange\f[R]
393393orange fruit
394394bank
395395.PP
396396Blank line after term, indented marker, alternate markers:
397397.TP
398−.B apple
398+\f[B]apple\f[R]
399399red fruit
400400computer
401401.TP
402−.B orange
402+\f[B]orange\f[R]
403403orange fruit
404404.RS
405405.IP "1." 3