Skip to content

Commit 1f4b25f

Browse files
committedOct 10, 2019
Remove escaping tilde character
1 parent f79a8a8 commit 1f4b25f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
 

‎md2man/roff.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ func out(w io.Writer, output string) {
310310
}
311311

312312
func needsBackslash(c byte) bool {
313-
for _, r := range []byte("-_&\\~") {
313+
for _, r := range []byte("-_&\\") {
314314
if c == r {
315315
return true
316316
}

‎md2man/roff_test.go

+8
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,14 @@ func TestLinks(t *testing.T) {
278278
doTestsInline(t, tests)
279279
}
280280

281+
func TestEscapeCharacters(t *testing.T) {
282+
var tests = []string{
283+
"Test-one_two&three\\four~five",
284+
".nh\n\n.PP\nTest\\-one\\_two\\&three\\\\four~five\n",
285+
}
286+
doTestsInline(t, tests)
287+
}
288+
281289
func execRecoverableTestSuite(t *testing.T, tests []string, params TestParams, suite func(candidate *string)) {
282290
// Catch and report panics. This is useful when running 'go test -v' on
283291
// the integration server. When developing, though, crash dump is often

0 commit comments

Comments
 (0)
Please sign in to comment.