From 1f4b25fc2a36be580747bf660cda25d514db3904 Mon Sep 17 00:00:00 2001 From: "Ivan Valdes (@ivanvc)" Date: Thu, 10 Oct 2019 10:19:25 -0700 Subject: [PATCH] Remove escaping tilde character --- md2man/roff.go | 2 +- md2man/roff_test.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/md2man/roff.go b/md2man/roff.go index 0668a66..13bba32 100644 --- a/md2man/roff.go +++ b/md2man/roff.go @@ -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 } diff --git a/md2man/roff_test.go b/md2man/roff_test.go index 1ac8fef..c6553c1 100644 --- a/md2man/roff_test.go +++ b/md2man/roff_test.go @@ -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