Skip to content

Commit

Permalink
Fix text after list
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevinrob committed Nov 3, 2023
1 parent 8da4375 commit ea4e028
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/reverse_markdown/converters/ol.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Converters
class Ol < Base
def convert(node, state = {})
ol_count = state.fetch(:ol_count, 0) + 1
"\n" << treat_children(node, state.merge(ol_count: ol_count))
"\n" << treat_children(node, state.merge(ol_count: ol_count)) << "\n"
end
end

Expand Down
2 changes: 1 addition & 1 deletion reverse_markdown.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'simplecov'
s.add_development_dependency 'rake'
s.add_development_dependency 'kramdown'
s.add_development_dependency 'byebug'
s.add_development_dependency 'debug'
s.add_development_dependency 'codeclimate-test-reporter'
end
5 changes: 5 additions & 0 deletions spec/assets/lists.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,10 @@
<li>delta</li>
</ul>

<ul>
<li>item followed with a text</li>
</ul>
text after the list

</body>
</html>
3 changes: 3 additions & 0 deletions spec/components/lists_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,7 @@
it { is_expected.to match /\n- delta\n/ }
end

context "text following list should have a new line separator" do
it { is_expected.to match /\n- item followed with a text\n\n text after the list/ }
end
end
2 changes: 1 addition & 1 deletion spec/lib/reverse_markdown_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

describe 'force_encoding option', jruby: :exclude do
it 'raises invalid byte sequence in UTF-8 exception' do
expect { ReverseMarkdown.convert("hi \255") }.to raise_error(ArgumentError)
expect { ReverseMarkdown.convert("hi \255") }.to raise_error(Encoding::CompatibilityError)
end

it 'handles invalid byte sequence if option is set' do
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'simplecov'
# require 'byebug'
require 'debug'

SimpleCov.profiles.define 'gem' do
add_filter '/spec/'
Expand Down

0 comments on commit ea4e028

Please sign in to comment.