项目原始demo,不改动
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.
 
 
 
 

19 lignes
618 B

  1. tools = require '../src/tools'
  2. describe "tools", ->
  3. describe "quote()", ->
  4. it "should convert html special strings to their entities", ->
  5. tools.quote(" abc<>\"\n")
  6. .should.equal '&sp;abc&lt;&gt;&quot;<br />'
  7. describe "stringToDom()", ->
  8. it "should work", ->
  9. tools.stringToDom('<a> text<a1>text</a1> text <a2>text</a2><a3>text</a3>text</a>text')
  10. describe "objectToDom()", ->
  11. it "should work", ->
  12. tools.objectToDom({a: 'text'})
  13. it "should have quoted text nodes", ->
  14. tools.objectToDom({a: '&<> "'})[0].children[0]
  15. .data.should.equal '&amp;&lt;&gt;&sp;&quot;'