This repository was archived by the owner on Jan 7, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -22,3 +22,12 @@ describe 'module contenteditable', ->
2222 expect (element (' #input' ).html ()).toBe ' a <span style="color:red">red</span> b'
2323 expect (element (' #input span' ).html ()).toBe ' red'
2424 expect (element (' #output' ).html ()).toBe ' a <span style="color:red">red</span> b'
25+
26+ it ' setting the model with some pure text should dispaly <br> instead of newlines \\ n' , ->
27+ input (' unformatted' ).enter (' #h1\n\n ##h2\n ###h3' );
28+ expect (element (' #output-unformatted' ).html ()).toBe ' #h1<br><br>##h2<br>###h3'
29+
30+ it ' putting some unformatted text with <br>s in the html should replace them with newlines' , ->
31+
32+ element (' #output-unformatted' ).html (' #h1<br><br>##h2<br>###h3' );
33+ expect (input (' unformatted' ).val ()).toBe (' #h1\n\n ##h2\n ###h3' );
Original file line number Diff line number Diff line change 3434 < hr >
3535 < label > Contenteditable without Model</ label >
3636 < div contenteditable > Edit me - I don't affect anything</ div >
37+ < hr >
38+ < label > Model has pure text</ label >
39+ < br >
40+ < textarea id ="input-unformatted " ng-model ="unformatted "> </ textarea >
41+ < div id ="output-unformatted " contenteditable ="true " ng-model ="unformatted " unformatted-text ="true "> </ div >
3742 </ div >
3843 </ body >
3944</ html >
You can’t perform that action at this time.
0 commit comments