mle86/man-to-md

Bold/italic blocks may be ended by \fP

rahra opened this issue · 2 comments

rahra commented

Bold and italic blocks started with \fB or \fI may be ended with \fP as well (not just \fR).
I did the following patch:

381,382c381,382
<       s/\\fB([^\*_]|.{2,}?)\\fR/**$1**/g;
<       s/\\fI([^\*_]|.{2,}?)\\fR/_$1_/g;
---
>       s/\\fB([^\*_]|.{2,}?)\\f[RP]/**$1**/g;
>       s/\\fI([^\*_]|.{2,}?)\\f[RP]/_$1_/g;
399,400c399,400
<       s#\\fB(\*|_)\\fR#<b>\\$1</b>#g;
<       s#\\fI(\*|_)\\fR#<i>\\$1</i>#g;
---
>       s#\\fB(\*|_)\\f[RP]#<b>\\$1</b>#g;
>       s#\\fI(\*|_)\\f[RP]#<i>\\$1</i>#g;
465,466c465,466
<       s#\\fB(.+?)\\fR#<b>$1</b>#g;
<       s#\\fI(.+?)\\fR#<i>$1</i>#g;
---
>       s#\\fB(.+?)\\f[RP]#<b>$1</b>#g;
>       s#\\fI(.+?)\\f[RP]#<i>$1</i>#g;
mle86 commented

Thanks, that's a good idea!

mle86 commented

Apparently, \fP does not select the standard (“roman”) font; it selects the previous font.
But I've checked several man pages that use \fP and they use it pretty much as one would use \fR: return to the standard font.