   dataText = dataText.replace(/'/g, '&apos;')   # ' -> &apos;
   dataText = dataText.replace(/\//g, '&#x2F;')  # / -> &#x2F;
   dataText = dataText.replace(/\n/g, '<br>')    # \n -> <br>
-  dataText = dataText.replace(/ /g, '&nbsp;')   # ' ' -> &nbsp;
+  # Coffee cannot compile if use literal '/ /g'
+  dataText = dataText.replace(new RegExp(' ', 'g'), '&nbsp;')   # ' ' -> &nbsp;
   return dataText
 
 colorfy = (dataText, descriptor, htmlfier) ->

#
# For the Japanese / Chinese input method issue
# http://stackoverflow.com/questions/1391278/contenteditable-change-events
#
# For the cursor issue
# ;(

    length = 0
    for childNode in node.childNodes
      length += lengthOfNode(childNode)
    return length

lengthOfNodeToOffset = (node, offset) ->
  if node.nodeType == Node.TEXT_NODE
    return offset
  else if node.tagName == "BR"
    # Hope this never happens
    console.log("Is this correct behavior?")
    return offset
  else if (node.tagName == "SPAN") || (node.tagName == "DIV")
    length = 0
    for i in [0...offset] by 1
      length += lengthOfNode(node.childNodes[i])
    return length

nodeAndOffsetFromCursorLocation = (location, node) ->
