~ixephus


#21 underline in underline word behavior 5 years ago

Ticket created by ~ixephus on ~sircmpwn/scdoc

This test currently fails, but I would expect it to succeed.

diff --git a/test/inline-formatting b/test/inline-formatting
index 7f61ba6..91e46f3 100755
--- a/test/inline-formatting
+++ b/test/inline-formatting
@@ -25,6 +25,14 @@ test(8)
 EOF
 end 0
 
+begin "Allows underscores in underlined words"
+scdoc <<EOF | grep '^\\fIhello_world\\fR' >/dev/null
+test(8)
+
+_hello_world_
+EOF
+end 0
+
 begin "Emits bold text"
 scdoc <<EOF | grep '^hello \\fBworld\\fR' >/dev/null
 test(8)

Current output:

$ scdoc <<EOF | grep hello 
test(8)

_hello_world_
EOF
\fIhello\fRworld_

The work around is of course very straightforward (_hello\_world_). The documentation seems to imply that underscores in the middle of words are disregarded, which led me to believe that the escape of the middle underscore was not necessary.

So maybe only a documentation update is required for clarification?