Skip to content

Commit

Permalink
Remove escaping tilde character
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvc committed Oct 10, 2019
1 parent f79a8a8 commit 1f4b25f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion md2man/roff.go
Expand Up @@ -310,7 +310,7 @@ func out(w io.Writer, output string) {
}

func needsBackslash(c byte) bool {
for _, r := range []byte("-_&\\~") {
for _, r := range []byte("-_&\\") {
if c == r {
return true
}
Expand Down
8 changes: 8 additions & 0 deletions md2man/roff_test.go
Expand Up @@ -278,6 +278,14 @@ func TestLinks(t *testing.T) {
doTestsInline(t, tests)
}

func TestEscapeCharacters(t *testing.T) {
var tests = []string{
"Test-one_two&three\\four~five",
".nh\n\n.PP\nTest\\-one\\_two\\&three\\\\four~five\n",
}
doTestsInline(t, tests)
}

func execRecoverableTestSuite(t *testing.T, tests []string, params TestParams, suite func(candidate *string)) {
// Catch and report panics. This is useful when running 'go test -v' on
// the integration server. When developing, though, crash dump is often
Expand Down

0 comments on commit 1f4b25f

Please sign in to comment.