diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2014-02-20 04:32:11 -0700 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2014-02-20 04:32:11 -0700 |
| commit | 0c4a21b4ade1df7767986c9bce84a7c3fdbee3c9 (patch) | |
| tree | 0f0787ef125d63ca76d82090b9d905126740cd97 | |
| parent | cc623f40d189adc4c825b2000be99e4f8bae6060 (diff) | |
chomp endline from stylesheets; small cleanups
| -rw-r--r-- | lib/asciidoctor/backends/_stylesheets.rb | 4 | ||||
| -rw-r--r-- | lib/asciidoctor/backends/docbook5.rb | 6 | ||||
| -rw-r--r-- | test/invoker_test.rb | 16 |
3 files changed, 14 insertions, 12 deletions
diff --git a/lib/asciidoctor/backends/_stylesheets.rb b/lib/asciidoctor/backends/_stylesheets.rb index 90513890..e61b3841 100644 --- a/lib/asciidoctor/backends/_stylesheets.rb +++ b/lib/asciidoctor/backends/_stylesheets.rb @@ -7,7 +7,7 @@ module HTML5 # use the following two lines to load a built-in theme instead #::Asciidoctor::Helpers.require_library 'coderay' #::CodeRay::Encoders[:html]::CSS.new(:default).stylesheet - <<'DEFAULT_CODERAY_STYLESHEET' + <<'DEFAULT_CODERAY_STYLESHEET'.chomp /* Foundation stylesheet for CodeRay (to match GitHub theme) | MIT License | http://foundation.zurb.com */ table.CodeRay { border-collapse: collapse; padding: 2px; margin-bottom: 0; border: 0; background: transparent; } table.CodeRay td { padding: 0 .5em; vertical-align: top; } @@ -109,7 +109,7 @@ DEFAULT_CODERAY_STYLESHEET # # returns the default Asciidoctor stylesheet as a String def self.default_asciidoctor_stylesheet - <<'DEFAULT_ASCIIDOCTOR_STYLESHEET' + <<'DEFAULT_ASCIIDOCTOR_STYLESHEET'.chomp /* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */ article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; } audio, canvas, video { display: inline-block; } diff --git a/lib/asciidoctor/backends/docbook5.rb b/lib/asciidoctor/backends/docbook5.rb index 8cd6c05e..2fd35550 100644 --- a/lib/asciidoctor/backends/docbook5.rb +++ b/lib/asciidoctor/backends/docbook5.rb @@ -677,7 +677,7 @@ end class BlockRulerTemplate < BaseTemplate def result node - %(<simpara><?asciidoc-hr?></simpara>) + '<simpara><?asciidoc-hr?></simpara>' end def template @@ -687,7 +687,7 @@ end class BlockPageBreakTemplate < BaseTemplate def result node - %(<simpara><?asciidoc-pagebreak?></simpara>) + '<simpara><?asciidoc-pagebreak?></simpara>' end def template @@ -697,7 +697,7 @@ end class InlineBreakTemplate < BaseTemplate def result node - %(#{@text}<?asciidoc-br?>) + %(#{node.text}<?asciidoc-br?>) end def template diff --git a/test/invoker_test.rb b/test/invoker_test.rb index 8ed52231..7a99fba1 100644 --- a/test/invoker_test.rb +++ b/test/invoker_test.rb @@ -308,13 +308,15 @@ context 'Invoker' do assert_xpath '/*[@id="preamble"]', output, 1 end - test 'should not compact output by default' do - # NOTE we are relying on the fact that the template leaves blank lines - # this will always fail when using a template engine which strips blank lines by default - invoker = invoke_cli_to_buffer(%w(-o -), '-') { '* content' } - output = invoker.read_output - assert_match(/\n[ \t]*\n/, output) - end + # no longer relevant + #test 'should not compact output by default' do + # # NOTE we are relying on the fact that the template leaves blank lines + # # this will always fail when using a template engine which strips blank lines by default + # invoker = invoke_cli_to_buffer(%w(-o -), '-') { '* content' } + # output = invoker.read_output + # puts output + # assert_match(/\n[ \t]*\n/, output) + #end test 'should compact output if specified' do # NOTE we are relying on the fact that the template leaves blank lines |
