 Utils = require('./utils')
 
 
-class Normalizer
-  @TAGS: {
+Normalizer =
+  TAGS: {
     'DIV'
     'BR'
     'SPAN'

  }

  # Make sure descendant break tags are not causing multiple lines to be rendered
  @handleBreaks: (lineNode) ->
    breaks = _.map(lineNode.querySelectorAll(DOM.DEFAULT_BREAK_TAG))
    _.each(breaks, (br) =>
      Utils.splitAncestors(br.nextSibling, lineNode.parentNode) if br.nextSibling?
    )
    return lineNode

  @normalizeLine: (lineNode) ->
    lineNode = Normalizer.wrapInline(lineNode)
    lineNode = Normalizer.handleBreaks(lineNode)
    Normalizer.pullBlocks(lineNode)
    Normalizer.wrapText(lineNode)
    return lineNode

  @normalizeNode: (node) ->
    Normalizer.whitelistStyles(node)
    return Normalizer.whitelistTags(node)

  # Make sure descendants are all inline elements
  @pullBlocks: (lineNode) ->
    curNode = lineNode.firstChild
    return unless curNode?
    if DOM.BLOCK_TAGS[curNode.tagName]?

      lineNode = nextNode
    return blockNode

  wrapText: (lineNode) ->
    texts = DOM.getTextNodes(lineNode)
    _.each(texts, (textNode) =>
      if textNode.previousSibling? or textNode.nextSibling? or textNode.parentNode == lineNode
