From e9d42beefef0b54a44af046567ea735f002c44cb Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sun, 28 Dec 2014 17:44:53 +0100 Subject: [PATCH] Beautify generated HTML examples --- lib/asciidoctor/doctest/html/examples_suite.rb | 2 +- spec/html/examples_suite_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/asciidoctor/doctest/html/examples_suite.rb b/lib/asciidoctor/doctest/html/examples_suite.rb index e60497b..1a80f59 100644 --- a/lib/asciidoctor/doctest/html/examples_suite.rb +++ b/lib/asciidoctor/doctest/html/examples_suite.rb @@ -98,7 +98,7 @@ def convert_example(example, opts, renderer) html.normalize! - create_example example.name, content: html.to_s, opts: opts + create_example example.name, content: HtmlBeautifier.beautify(html), opts: opts end private diff --git a/spec/html/examples_suite_spec.rb b/spec/html/examples_suite_spec.rb index f5a46b1..4fa425c 100644 --- a/spec/html/examples_suite_spec.rb +++ b/spec/html/examples_suite_spec.rb @@ -230,7 +230,7 @@ let(:rendered) { '

chunky bacon

' } it 'returns content without top-level

tags' do - expect(result.content).to eq 'chunky bacon' + expect(result.content.gsub(/\s+/, ' ')).to eq 'chunky bacon' end it 'does not add implicit include into returned example' do