Skip to content

Commit

Permalink
remove support for deprecated font tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Jan 13, 2015
1 parent e168fd3 commit 733b0a2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
13 changes: 0 additions & 13 deletions src/core/normalizer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ class Normalizer
'STRIKE' : 'S'
}

@ATTRIBUTES: {
'color': 'color'
'face' : 'fontFamily'
'size' : 'fontSize'
}

@STYLES: {
'background-color'
'color'
Expand Down Expand Up @@ -61,13 +55,6 @@ class Normalizer

@normalizeNode: (node) ->
return node if dom(node).isTextNode()
_.each(Normalizer.ATTRIBUTES, (style, attribute) ->
if node.hasAttribute(attribute)
value = node.getAttribute(attribute)
value = dom.convertFontSize(value) if attribute == 'size'
node.style[style] = value
node.removeAttribute(attribute)
)
Normalizer.whitelistStyles(node)
return Normalizer.whitelistTags(node)

Expand Down
6 changes: 0 additions & 6 deletions test/unit/core/normalizer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ describe('Normalizer', ->
expect(@container).toEqualHTML('<b style="color: red;">Test</b>')
)

it('convert size attribute', ->
@container.innerHTML = '<font size="3">Test</font>'
Quill.Normalizer.normalizeNode(@container.firstChild)
expect(@container).toEqualHTML('<span style="font-size: 16px;">Test</span>')
)

it('text node', ->
@container.innerHTML = 'Test'
Quill.Normalizer.normalizeNode(@container.firstChild)
Expand Down

0 comments on commit 733b0a2

Please sign in to comment.