Skip to content

Commit

Permalink
Make inline tags inline-block
Browse files Browse the repository at this point in the history
Fixes #61
  • Loading branch information
jhchen committed Aug 20, 2014
1 parent 1bf6c57 commit 2b747c8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/renderer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,21 @@ DEFAULT_STYLES =
'.editor-container ol' : { 'margin': '0 0 0 2em', 'padding': '0', 'list-style-type': 'decimal' }
'.editor-container ul' : { 'margin': '0 0 0 2em', 'padding': '0', 'list-style-type': 'disc' }

# Make inline tags inline-block
tags = _.reduce(Normalizer.TAGS, (tags, tag) ->
tags.push(".editor-container #{tag.toLowerCase()}") unless dom.BLOCK_TAGS[tag]? or dom.VOID_TAGS[tag]?
return tags
, [])
DEFAULT_STYLES[tags.join(', ')] = { 'display': 'inline-block' }

LIST_STYLES = ['decimal', 'lower-alpha', 'lower-roman']
rule = '.editor-container ol > li'
_.each([1..9], (i) ->
rule += ' > ol'
DEFAULT_STYLES[rule] = { 'list-style-type': LIST_STYLES[i%3] }
rule += ' > li'
)

DEFAULT_STYLES[dom.DEFAULT_BREAK_TAG] = { 'display': 'none' } if dom.isIE(10)


Expand Down

0 comments on commit 2b747c8

Please sign in to comment.