This repository was archived by the owner on Jan 7, 2020. It is now read-only.
File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -22,3 +22,12 @@ describe 'module contenteditable', ->
22
22
expect (element (' #input' ).html ()).toBe ' a <span style="color:red">red</span> b'
23
23
expect (element (' #input span' ).html ()).toBe ' red'
24
24
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 34
34
< hr >
35
35
< label > Contenteditable without Model</ label >
36
36
< div contenteditable > Edit me - I don't affect anything</ div >
37
+ < hr >
38
+ < label > Model has pure text</ label >
39
+ < br >
40
+ < textarea id ="inputUnformatted " ng-model ="unformatted "> </ textarea >
41
+ < div id ="output-unformatted " contenteditable ="true " ng-model ="unformatted " unformatted-text ="true "> </ div >
37
42
</ div >
38
43
</ body >
39
44
</ html >
You can’t perform that action at this time.
0 commit comments