Skip to content

Commit 507bee0

Browse files
committed
Flatten to ul/ol types, refs the-grid/ed#300
1 parent 5daaeda commit 507bee0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

index.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,9 @@ module.exports = class Flatten
342342
type: 'code'
343343
html: @tagToHtml tag, id
344344
when 'ul', 'ol', 'dl'
345+
type = if tag.name in ['ul', 'ol'] then tag.name else 'list'
345346
results.push
346-
type: 'list'
347+
type: type
347348
html: @tagToHtml tag, id
348349
when 'blockquote'
349350
results.push

spec/Flatten.coffee

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ describe 'Flatten', ->
393393
items: [
394394
id: '6010f3ac-63f2-4407-a65d-9d6b7e9a40f2'
395395
content: [
396-
type: 'list'
396+
type: 'ul'
397397
html: '<ul><li>Hello world<ul><li>Foo</li></ul></li><li>Foo bar</li></ul>'
398398
]
399399
]
@@ -429,7 +429,7 @@ describe 'Flatten', ->
429429
items: [
430430
id: '6010f3ac-63f2-4407-a65d-9d6b7e9a40f2'
431431
content: [
432-
type: 'list'
432+
type: 'ul'
433433
html: '<ul><li>Hello world<ul><li>Foo</li></ul></li><li>Foo bar</li></ul>'
434434
]
435435
]
@@ -469,7 +469,7 @@ describe 'Flatten', ->
469469
items: [
470470
id: '6010f3ac-63f2-4407-a65d-9d6b7e9a40f2'
471471
content: [
472-
type: 'list'
472+
type: 'ul'
473473
html: '<ul><li>Hello world<ul><li>Foo</li></ul></li><li>Foo bar</li></ul>'
474474
]
475475
]
@@ -575,7 +575,7 @@ describe 'Flatten', ->
575575
html: "<p>three<br>four</p>"
576576
text: 'three four'
577577
,
578-
type: 'list'
578+
type: 'ul'
579579
html: "<ul><li>br at end</li></ul>"
580580
,
581581
type: 'text'

0 commit comments

Comments
 (0)