@@ -16,6 +16,29 @@ public void Format_RTE_Data_For_Editor_With_No_Macros()
16
16
Assert . AreEqual ( @"<p>hello world</p>" , content ) ;
17
17
}
18
18
19
+ [ Test ]
20
+ public void Format_RTE_Data_For_Editor_With_Non_AlphaNumeric_Char_In_Alias ( )
21
+ {
22
+ var content = @"<p>asdfasdf</p>
23
+ <p>asdfsadf</p>
24
+ <?UMBRACO_MACRO macroAlias=""My.Map.isCool"" />
25
+ <p>asdfasdf</p>" ;
26
+ var result = MacroTagParser . FormatRichTextPersistedDataForEditor ( content , new Dictionary < string , string > ( ) { { "test1" , "value1" } , { "test2" , "value2" } } ) ;
27
+
28
+ // Assert.AreEqual(@"<p>asdfasdf</p>
29
+ //<p>asdfsadf</p>
30
+ //<div class=""umb-macro-holder Map mceNonEditable"" test1=""value1"" test2=""value2"">
31
+ //<!-- <?UMBRACO_MACRO macroAlias=""Map"" /> -->
32
+ //<ins>Macro alias: <strong>Map</strong></ins></div>
33
+ //<p>asdfasdf</p>".Replace(Environment.NewLine, string.Empty), result.Replace(Environment.NewLine, string.Empty));
34
+ Assert . AreEqual ( @"<p>asdfasdf</p>
35
+ <p>asdfsadf</p>
36
+ <div class=""umb-macro-holder mceNonEditable"" test1=""value1"" test2=""value2"">
37
+ <!-- <?UMBRACO_MACRO macroAlias=""My.Map.isCool"" /> -->
38
+ <ins>Macro alias: <strong>My.Map.isCool</strong></ins></div>
39
+ <p>asdfasdf</p>" . Replace ( Environment . NewLine , string . Empty ) , result . Replace ( Environment . NewLine , string . Empty ) ) ;
40
+ }
41
+
19
42
[ Test ]
20
43
public void Format_RTE_Data_For_Editor ( )
21
44
{
@@ -25,9 +48,16 @@ public void Format_RTE_Data_For_Editor()
25
48
<p>asdfasdf</p>" ;
26
49
var result = MacroTagParser . FormatRichTextPersistedDataForEditor ( content , new Dictionary < string , string > ( ) { { "test1" , "value1" } , { "test2" , "value2" } } ) ;
27
50
51
+ // Assert.AreEqual(@"<p>asdfasdf</p>
52
+ //<p>asdfsadf</p>
53
+ //<div class=""umb-macro-holder Map mceNonEditable"" test1=""value1"" test2=""value2"">
54
+ //<!-- <?UMBRACO_MACRO macroAlias=""Map"" /> -->
55
+ //<ins>Macro alias: <strong>Map</strong></ins></div>
56
+ //<p>asdfasdf</p>".Replace(Environment.NewLine, string.Empty), result.Replace(Environment.NewLine, string.Empty));
57
+
28
58
Assert . AreEqual ( @"<p>asdfasdf</p>
29
59
<p>asdfsadf</p>
30
- <div class=""umb-macro-holder Map mceNonEditable"" test1=""value1"" test2=""value2"">
60
+ <div class=""umb-macro-holder mceNonEditable"" test1=""value1"" test2=""value2"">
31
61
<!-- <?UMBRACO_MACRO macroAlias=""Map"" /> -->
32
62
<ins>Macro alias: <strong>Map</strong></ins></div>
33
63
<p>asdfasdf</p>" . Replace ( Environment . NewLine , string . Empty ) , result . Replace ( Environment . NewLine , string . Empty ) ) ;
@@ -42,9 +72,15 @@ public void Format_RTE_Data_For_Editor_Closing_Tag()
42
72
<p>asdfasdf</p>" ;
43
73
var result = MacroTagParser . FormatRichTextPersistedDataForEditor ( content , new Dictionary < string , string > ( ) { { "test1" , "value1" } , { "test2" , "value2" } } ) ;
44
74
75
+ // Assert.AreEqual(@"<p>asdfasdf</p>
76
+ //<p>asdfsadf</p>
77
+ //<div class=""umb-macro-holder Map mceNonEditable"" test1=""value1"" test2=""value2"">
78
+ //<!-- <?UMBRACO_MACRO macroAlias=""Map"" /> -->
79
+ //<ins>Macro alias: <strong>Map</strong></ins></div>
80
+ //<p>asdfasdf</p>".Replace(Environment.NewLine, string.Empty), result.Replace(Environment.NewLine, string.Empty));
45
81
Assert . AreEqual ( @"<p>asdfasdf</p>
46
82
<p>asdfsadf</p>
47
- <div class=""umb-macro-holder Map mceNonEditable"" test1=""value1"" test2=""value2"">
83
+ <div class=""umb-macro-holder mceNonEditable"" test1=""value1"" test2=""value2"">
48
84
<!-- <?UMBRACO_MACRO macroAlias=""Map"" /> -->
49
85
<ins>Macro alias: <strong>Map</strong></ins></div>
50
86
<p>asdfasdf</p>" . Replace ( Environment . NewLine , string . Empty ) , result . Replace ( Environment . NewLine , string . Empty ) ) ;
@@ -59,9 +95,15 @@ public void Format_RTE_Data_For_Editor_With_Params()
59
95
<p>asdfasdf</p>" ;
60
96
var result = MacroTagParser . FormatRichTextPersistedDataForEditor ( content , new Dictionary < string , string > ( ) { { "test1" , "value1" } , { "test2" , "value2" } } ) ;
61
97
98
+ // Assert.AreEqual(@"<p>asdfasdf</p>
99
+ //<p>asdfsadf</p>
100
+ //<div class=""umb-macro-holder Map mceNonEditable"" test1=""value1"" test2=""value2"">
101
+ //<!-- <?UMBRACO_MACRO macroAlias=""Map"" test1=""value1"" test2=""value2"" /> -->
102
+ //<ins>Macro alias: <strong>Map</strong></ins></div>
103
+ //<p>asdfasdf</p>".Replace(Environment.NewLine, string.Empty), result.Replace(Environment.NewLine, string.Empty));
62
104
Assert . AreEqual ( @"<p>asdfasdf</p>
63
105
<p>asdfsadf</p>
64
- <div class=""umb-macro-holder Map mceNonEditable"" test1=""value1"" test2=""value2"">
106
+ <div class=""umb-macro-holder mceNonEditable"" test1=""value1"" test2=""value2"">
65
107
<!-- <?UMBRACO_MACRO macroAlias=""Map"" test1=""value1"" test2=""value2"" /> -->
66
108
<ins>Macro alias: <strong>Map</strong></ins></div>
67
109
<p>asdfasdf</p>" . Replace ( Environment . NewLine , string . Empty ) , result . Replace ( Environment . NewLine , string . Empty ) ) ;
@@ -76,9 +118,15 @@ public void Format_RTE_Data_For_Editor_With_Params_Closing_Tag()
76
118
<p>asdfasdf</p>" ;
77
119
var result = MacroTagParser . FormatRichTextPersistedDataForEditor ( content , new Dictionary < string , string > ( ) { { "test1" , "value1" } , { "test2" , "value2" } } ) ;
78
120
121
+ // Assert.AreEqual(@"<p>asdfasdf</p>
122
+ //<p>asdfsadf</p>
123
+ //<div class=""umb-macro-holder Map mceNonEditable"" test1=""value1"" test2=""value2"">
124
+ //<!-- <?UMBRACO_MACRO macroAlias=""Map"" test1=""value1"" test2=""value2"" /> -->
125
+ //<ins>Macro alias: <strong>Map</strong></ins></div>
126
+ //<p>asdfasdf</p>".Replace(Environment.NewLine, string.Empty), result.Replace(Environment.NewLine, string.Empty));
79
127
Assert . AreEqual ( @"<p>asdfasdf</p>
80
128
<p>asdfsadf</p>
81
- <div class=""umb-macro-holder Map mceNonEditable"" test1=""value1"" test2=""value2"">
129
+ <div class=""umb-macro-holder mceNonEditable"" test1=""value1"" test2=""value2"">
82
130
<!-- <?UMBRACO_MACRO macroAlias=""Map"" test1=""value1"" test2=""value2"" /> -->
83
131
<ins>Macro alias: <strong>Map</strong></ins></div>
84
132
<p>asdfasdf</p>" . Replace ( Environment . NewLine , string . Empty ) , result . Replace ( Environment . NewLine , string . Empty ) ) ;
@@ -93,9 +141,15 @@ public void Format_RTE_Data_For_Editor_With_Params_Closing_Tag_And_Content()
93
141
<p>asdfasdf</p>" ;
94
142
var result = MacroTagParser . FormatRichTextPersistedDataForEditor ( content , new Dictionary < string , string > ( ) { { "test1" , "value1" } , { "test2" , "value2" } } ) ;
95
143
144
+ // Assert.AreEqual(@"<p>asdfasdf</p>
145
+ //<p>asdfsadf</p>
146
+ //<div class=""umb-macro-holder Map mceNonEditable"" test1=""value1"" test2=""value2"">
147
+ //<!-- <?UMBRACO_MACRO macroAlias=""Map"" test1=""value1"" test2=""value2"" /> -->
148
+ //<ins>Macro alias: <strong>Map</strong></ins></div>
149
+ //<p>asdfasdf</p>".Replace(Environment.NewLine, string.Empty), result.Replace(Environment.NewLine, string.Empty));
96
150
Assert . AreEqual ( @"<p>asdfasdf</p>
97
151
<p>asdfsadf</p>
98
- <div class=""umb-macro-holder Map mceNonEditable"" test1=""value1"" test2=""value2"">
152
+ <div class=""umb-macro-holder mceNonEditable"" test1=""value1"" test2=""value2"">
99
153
<!-- <?UMBRACO_MACRO macroAlias=""Map"" test1=""value1"" test2=""value2"" /> -->
100
154
<ins>Macro alias: <strong>Map</strong></ins></div>
101
155
<p>asdfasdf</p>" . Replace ( Environment . NewLine , string . Empty ) , result . Replace ( Environment . NewLine , string . Empty ) ) ;
@@ -104,10 +158,26 @@ public void Format_RTE_Data_For_Editor_With_Params_Closing_Tag_And_Content()
104
158
[ Test ]
105
159
public void Format_RTE_Data_For_Persistence ( )
106
160
{
161
+ // var content = @"<html>
162
+ //<body>
163
+ //<h1>asdfasdf</h1>
164
+ //<div class='umb-macro-holder Map mceNonEditable' att1='asdf' att2='asdfasdfasdf' att3=""sdfsdfd"">
165
+ //<!-- <?UMBRACO_MACRO macroAlias=""myMacro"" param1=""test1"" param2=""test2"" /> -->
166
+ //asdfasdf
167
+ //asdfas
168
+ //<span>asdfasdfasdf</span>
169
+ //<p>asdfasdf</p>
170
+ //</div>
171
+ //<span>asdfdasf</span>
172
+ //<div>
173
+ //asdfsdf
174
+ //</div>
175
+ //</body>
176
+ //</html>";
107
177
var content = @"<html>
108
178
<body>
109
179
<h1>asdfasdf</h1>
110
- <div class='umb-macro-holder Map mceNonEditable' att1='asdf' att2='asdfasdfasdf' att3=""sdfsdfd"">
180
+ <div class='umb-macro-holder mceNonEditable' att1='asdf' att2='asdfasdfasdf' att3=""sdfsdfd"">
111
181
<!-- <?UMBRACO_MACRO macroAlias=""myMacro"" param1=""test1"" param2=""test2"" /> -->
112
182
asdfasdf
113
183
asdfas
@@ -170,7 +240,15 @@ public void Format_RTE_Data_For_Persistence_No_Class()
170
240
[ Test ]
171
241
public void Format_RTE_Data_For_Persistence_Custom_Single_Entry ( )
172
242
{
173
- var content = @"<div class=""umb-macro-holder Test mceNonEditable umb-macro-mce_1""><!-- <?UMBRACO_MACRO macroAlias=""Test"" content=""1089"" textArea=""asdfasdf"" title="""" bool=""0"" number="""" contentType="""" multiContentType="""" multiProperties="""" properties="""" tabs="""" multiTabs="""" /> --><ins>
243
+ // var content = @"<div class=""umb-macro-holder Test mceNonEditable umb-macro-mce_1""><!-- <?UMBRACO_MACRO macroAlias=""Test"" content=""1089"" textArea=""asdfasdf"" title="""" bool=""0"" number="""" contentType="""" multiContentType="""" multiProperties="""" properties="""" tabs="""" multiTabs="""" /> --><ins>
244
+ //<div class=""facts-box"">
245
+ //<div class=""fatcs-box-header"">
246
+ //<h3>null</h3>
247
+ //</div>
248
+ //<div class=""fatcs-box-body"">1089</div>
249
+ //</div>
250
+ //</ins></div>";
251
+ var content = @"<div class=""umb-macro-holder mceNonEditable umb-macro-mce_1""><!-- <?UMBRACO_MACRO macroAlias=""Test"" content=""1089"" textArea=""asdfasdf"" title="""" bool=""0"" number="""" contentType="""" multiContentType="""" multiProperties="""" properties="""" tabs="""" multiTabs="""" /> --><ins>
174
252
<div class=""facts-box"">
175
253
<div class=""fatcs-box-header"">
176
254
<h3>null</h3>
0 commit comments