@@ -400,21 +400,27 @@ impl<'e> ManRenderer<'e> {
400400}
401401
402402fn escape ( s : & str ) -> Result < String , Error > {
403+ // Note: Possible source on output escape sequences: https://man7.org/linux/man-pages/man7/groff_char.7.html.
404+ // Otherwise, use generic escaping in the form `\[u1EE7]` or `\[u1F994]`.
405+
403406 let mut replaced = s
404407 . replace ( '\\' , "\\ (rs" )
405408 . replace ( '-' , "\\ -" )
406409 . replace ( '\u{00A0}' , "\\ " ) // non-breaking space (non-stretchable)
407410 . replace ( '–' , "\\ [en]" ) // \u{2013} en-dash
408411 . replace ( '—' , "\\ [em]" ) // \u{2014} em-dash
412+ . replace ( '‘' , "\\ [oq]" ) // \u{2018} left single quote
413+ . replace ( '’' , "\\ [cq]" ) // \u{2019} right single quote or apostrophe
414+ . replace ( '“' , "\\ [lq]" ) // \u{201C} left double quote
415+ . replace ( '”' , "\\ [rq]" ) // \u{201D} right double quote
416+ . replace ( '…' , "\\ [u2026]" ) // \u{2026} ellipsis
409417 . replace ( '│' , "|" ) // \u{2502} box drawing light vertical (could use \[br])
410418 . replace ( '├' , "|" ) // \u{251C} box drawings light vertical and right
411419 . replace ( '└' , "`" ) // \u{2514} box drawings light up and right
412420 . replace ( '─' , "\\ -" ) // \u{2500} box drawing light horizontal
413421 ;
414422 if replaced. starts_with ( '.' ) {
415423 replaced = format ! ( "\\ &.{}" , & replaced[ 1 ..] ) ;
416- } else if replaced. starts_with ( '\'' ) {
417- replaced = format ! ( "\\ (aq{}" , & replaced[ 1 ..] ) ;
418424 }
419425
420426 if let Some ( ch) = replaced. chars ( ) . find ( |ch| {
0 commit comments