fix for dangling li #2

Merged
3 commits merged into from Jan 24, 2011

Projects

None yet

3 participants

@stepheneb

fix for dangling li: double_return now matches double or more returns

This pull request includes Noah's pull request which adds a spec test for this behavior:
#1

perhaps the name: 'double_return' should be changed to be more descriptive ...

See: http://jgarber.lighthouseapp.com/projects/13054/tickets/183-three-newlines-after-a-list-at-end-of-file-make-dangling-li

All tests pass running in ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] running:

bundle exec rake spec

All tests also pass in ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.5.0]

but ... I didn't get this to work with bundle exec -- instead the tests passed running: rspec spec

Two tests fail in:
jruby 1.5.6 (ruby 1.8.7 patchlevel 249) (2010-12-03 9cf97c3) (OpenJDK 64-Bit Server VM 1.7.0-internal) [universal-java]

But these same two tests fail in the master branch:

Failures:
  1) RedCloth should have EXTENSION_LANGUAGE
     Failure/Error: RedCloth::DESCRIPTION.should include(RedCloth::EXTENSION_LANGUAGE)
     expected "RedCloth-4.2.4.pre3 - Textile parser for Ruby.\nhttp://redcloth.org/" to include "Java"
     # :1

  2) HTML should output html for threshold lang attribute
     Failure/Error: output.should == doc[formatter]
     expected: "<p lang=\"fr-fr\">En fran\303\247ais.</p>",
          got: "<p lang=\"fr-fr\">En fran</p>" (using ==)
     # :1

FYI: this was the error I got running the tests with bundle exec in ruby 1.9.2

$ bundle exec rake spec
(in /Users/stephen/dev/ruby/src/gems/redcloth-git)
mkdir -p tmp/x86_64-darwin10.5.0/redcloth_scan/1.9.2
cd tmp/x86_64-darwin10.5.0/redcloth_scan/1.9.2
/Users/stephen/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -I. ../../../../ext/redcloth_scan/extconf.rb
checking for main() in -lc... yes
creating Makefile
cd -
cd tmp/x86_64-darwin10.5.0/redcloth_scan/1.9.2
make
gcc -I. 
[...]
cd -
cp tmp/x86_64-darwin10.5.0/redcloth_scan/1.9.2/redcloth_scan.bundle lib/redcloth_scan.bundle
/Users/stephen/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -S bundle exec rspec "./spec/benchmark_spec.rb" "./spec/custom_tags_spec.rb" "./spec/erb_spec.rb" "./spec/extension_spec.rb" "./spec/formatters/class_filtered_html_spec.rb" "./spec/formatters/filtered_html_spec.rb" "./spec/formatters/html_no_breaks_spec.rb" "./spec/formatters/html_spec.rb" "./spec/formatters/id_filtered_html_spec.rb" "./spec/formatters/latex_spec.rb" "./spec/formatters/lite_mode_html_spec.rb" "./spec/formatters/no_span_caps_html_spec.rb" "./spec/formatters/sanitized_html_spec.rb" "./spec/formatters/style_filtered_html_spec.rb" "./spec/parser_spec.rb"
/Users/stephen/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rubygems.rb:762:in `report_activate_error': Could not find RubyGem bundler (>= 0) (Gem::LoadError)
    from /Users/stephen/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rubygems.rb:219:in `activate'
    from /Users/stephen/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/rubygems.rb:1065:in `gem'
    from /Users/stephen/.rvm/gems/ruby-1.9.2-p136@global/bin/bundle:18:in `<main>'
rake aborted!
ruby -S bundle exec rspec "./spec/benchmark_spec.rb" "./spec/custom_tags_spec.rb" "./spec/erb_spec.rb" "./spec/extension_spec.rb" "./spec/formatters/class_filtered_html_spec.rb" "./spec/formatters/filtered_html_spec.rb" "./spec/formatters/html_no_breaks_spec.rb" "./spec/formatters/html_spec.rb" "./spec/formatters/id_filtered_html_spec.rb" "./spec/formatters/latex_spec.rb" "./spec/formatters/lite_mode_html_spec.rb" "./spec/formatters/no_span_caps_html_spec.rb" "./spec/formatters/sanitized_html_spec.rb" "./spec/formatters/style_filtered_html_spec.rb" "./spec/parser_spec.rb" failed

(See full trace by running task with --trace)
knowuh and others added some commits Jan 13, 2011
@knowuh knowuh spec exposes trailing <li> bug.
Happens when there are more than 3 trailing 
newlines following a ul.
5465bf8
@knowuh knowuh spec test typeo "thee => three" for legibility. e652ef7
@stepheneb stepheneb fix dangling <li>
double_return now matches double or more returns

perhaps the name: 'double_return' should be changed also

http://jgarber.lighthouseapp.com/projects/13054/tickets/183-three-newlines-after-a-list-at-end-of-file-make-dangling-li
ade0bfd
@jgarber
Owner

Thanks! I'm excited to pull it. Won't be able to until I get back from Costa Rica, though (another week). Thanks again!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment