Skip to content

Commit d401a6e

Browse files
committed
Changed explanation formatter to not add automatic <br> in text.
1 parent 2004e37 commit d401a6e

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

lib/rspec_api_documentation/views/slate_example.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ def initialize(example, configuration)
66
self.template_name = "rspec_api_documentation/slate_example"
77
end
88

9-
def explanation_with_linebreaks
10-
explanation.gsub "\n", "<br>\n"
11-
end
12-
139
def write
1410
File.open(configuration.docs_dir.join("#{FILENAME}.#{extension}"), 'w+') do |file|
1511

spec/views/slate_example_spec.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,4 @@
1010
let(:configuration) { RspecApiDocumentation::Configuration.new }
1111
let(:slate_example) { described_class.new(rad_example, configuration) }
1212

13-
describe '#explanation_with_linebreaks' do
14-
it 'returns the explanation with HTML linebreaks' do
15-
explanation = "Line 1\nLine 2\nLine 3\Line 4"
16-
allow(slate_example).to receive(:explanation).and_return explanation
17-
expect(slate_example.explanation_with_linebreaks).to be == explanation.gsub("\n", "<br>\n")
18-
end
19-
end
2013
end

templates/rspec_api_documentation/slate_example.mustache

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
## {{ description }}
22

33
{{# explanation }}
4-
5-
{{{ explanation_with_linebreaks }}}
4+
{{{ explanation }}}
65
{{/ explanation }}
76

87
### Request

0 commit comments

Comments
 (0)