breakout_parser 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ [ 0.0.14 ]
2
+
3
+ * fix handling of broken multilevel lists, re https://www.assembla.com/spaces/breakout/tickets/5902
4
+
1
5
  [ 0.0.13 ]
2
6
 
3
7
  * add "h-" to header ids
@@ -2120,12 +2120,12 @@ process_uli(int level){
2120
2120
  if( level == list_level ){
2121
2121
  concat("<li>",4);
2122
2122
  } else if( level < list_level ){
2123
- list_level = level;
2123
+ list_level--;
2124
2124
  //unconcat("</li>");
2125
2125
  concat("</ul></li><li>",14);
2126
2126
  } else {
2127
2127
  // if(level > list_level)
2128
- list_level = level;
2128
+ list_level++;
2129
2129
  unconcat("</li>");
2130
2130
  concat("<ul><li>",8);
2131
2131
  }
@@ -196,12 +196,12 @@ process_uli(int level){
196
196
  if( level == list_level ){
197
197
  concat("<li>",4);
198
198
  } else if( level < list_level ){
199
- list_level = level;
199
+ list_level--;
200
200
  //unconcat("</li>");
201
201
  concat("</ul></li><li>",14);
202
202
  } else {
203
203
  // if(level > list_level)
204
- list_level = level;
204
+ list_level++;
205
205
  unconcat("</li>");
206
206
  concat("<ul><li>",8);
207
207
  }
data/spec/parser_spec.rb CHANGED
@@ -350,12 +350,18 @@ describe 'BreakoutParser' do
350
350
  it "mess - should have matching count of opening and closing tags" do
351
351
  r = parse(get_data('list4'))
352
352
  r.scan('<ul>').count.should > 0
353
- r.scan('<ul>').count.should <= r.scan('</ul>').count
353
+ r.scan('<ul>').count.should == r.scan('</ul>').count
354
354
  end
355
355
 
356
356
  it "at end" do
357
357
  parse(get_data('list5')).should == unformat(get_data('list5.html'))
358
358
  end
359
+
360
+ it "handles broken lists correctly - https://www.assembla.com/spaces/breakout/tickets/5902" do
361
+ r = parse(get_data('list6'))
362
+ r.scan('<ul>').count.should > 0
363
+ r.scan('<ul>').count.should == r.scan('</ul>').count
364
+ end
359
365
  end
360
366
  end
361
367
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breakout_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey "Zed" Zaikin
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-04-27 00:00:00 +06:00
12
+ date: 2010-05-11 00:00:00 +06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency