scdoc2mdoc

A fork of scdoc to output mdoc(7)
git clone git://git.sgregoratto.me/scdoc2mdoc
Log | Files | Refs | README | LICENSE

inline-formatting (837B)


      1 #!/bin/sh
      2 . test/lib.sh
      3 
      4 begin "Disallows nested formatting"
      5 scdoc <<EOF >/dev/null
      6 test(8)
      7 
      8 _hello *world*_
      9 EOF
     10 end 1
     11 
     12 begin "Ignores underscores in words"
     13 scdoc <<EOF | grep -v 'fR' >/dev/null
     14 test(8)
     15 
     16 hello_world
     17 EOF
     18 end 0
     19 
     20 begin "Ignores underscores in underlined words"
     21 scdoc <<EOF | grep '\\fIhello_world\\fR' >/dev/null
     22 test(8)
     23 
     24 _hello_world_
     25 EOF
     26 end 0
     27 
     28 begin "Ignores underscores in bolded words"
     29 scdoc <<EOF | grep '^\\fBhello_world\\fR' >/dev/null
     30 test(8)
     31 
     32 *hello_world*
     33 EOF
     34 end 0
     35 
     36 begin "Emits bold text"
     37 scdoc <<EOF | grep '^hello \\fBworld\\fR' >/dev/null
     38 test(8)
     39 
     40 hello *world*
     41 EOF
     42 end 0
     43 
     44 begin "Emits underlined text"
     45 scdoc <<EOF | grep '^hello \\fIworld\\fR' >/dev/null
     46 test(8)
     47 
     48 hello _world_
     49 EOF
     50 end 0
     51 
     52 begin "Handles escaped characters"
     53 scdoc <<EOF | grep '^hello _world_' >/dev/null
     54 test(8)
     55 
     56 hello \_world\_
     57 EOF
     58 end 0