Skip to content

Commit aa1aeed

Browse files
committed
change String#to_manpage behavior
1 parent fc767e7 commit aa1aeed

File tree

5 files changed

+5
-7
lines changed

5 files changed

+5
-7
lines changed

examples/render-mandoc/docs/download.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,4 @@ Download from \<https://aws.amazon.com/cli/\>
6161

6262

6363
# ISSUE TRACKER
64-
6564
Report issues at \<https://github.com/lanalang/smallville\>

examples/render-markdown/docs/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,4 @@ Overwrite existing files
4848
Show debug information
4949

5050
# ISSUE TRACKER
51-
5251
Report issues at \<https://github.com/lanalang/smallville\>

lib/bashly/extensions/string.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def for_markdown
88
end
99

1010
def for_manpage
11-
gsub('<', '\\<').gsub('>', '\\>').gsub('`', '**').gsub("\n", "\n\n")
11+
gsub('<', '\\<').gsub('>', '\\>').gsub('`', '**').gsub(" \n", "\n\n")
1212
end
1313

1414
def nl2br

spec/approvals/examples/render-mandoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
+ bashly render :mandoc docs
22
saved docs/download.md
33
saved docs/download.1
4-
+ col -bx
54
+ man docs/download.1
5+
+ col -bx
66
download(1) Sample application download(1)
77

88
NAME

spec/bashly/extensions/string_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
end
1717

1818
describe '#for_manpage' do
19-
subject { "line one\n`line two` is <tagged>\n" }
19+
subject { "line one \n`line two` \nand <tagged>\n" }
2020

21-
it 'doubles newlines, escapes < > characters and converts ` => **' do
22-
expect(subject.for_manpage).to eq "line one\n\n**line two** is \\<tagged\\>\n\n"
21+
it 'doubles soft newlines, escapes < > characters and converts ` => **' do
22+
expect(subject.for_manpage).to eq "line one\n\n**line two**\n\nand \\<tagged\\>\n"
2323
end
2424
end
2525

0 commit comments

Comments
 (0)