File tree 3 files changed +9
-2
lines changed
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ public string ConvertContent(Content obj)
17
17
{
18
18
if ( String . IsNullOrEmpty ( obj . htmlContent ) ) return "" ;
19
19
20
+ // preserve <nowiki>
21
+ obj . htmlContent = obj . htmlContent . Replace ( "<nowiki>" , "_nowiki_" ) ;
22
+ obj . htmlContent = obj . htmlContent . Replace ( "</nowiki>" , "_/nowiki_" ) ;
23
+
20
24
string fileName = String . Format ( "{0}.txt" , Guid . NewGuid ( ) . ToString ( ) ) ;
21
25
string fileDirectory = HttpContext . Current . Server . MapPath ( "~/temp" ) ;
22
26
string filePath = String . Concat ( fileDirectory , "\\ " , fileName ) ;
@@ -45,6 +49,9 @@ public string ConvertContent(Content obj)
45
49
46
50
output = output . Replace ( "{|" , "{| class=\" wikitable\" " ) ;
47
51
output = new Regex ( "(width=.{0,12}[|] )" ) . Replace ( output , " " ) ;
52
+ // revive <nowiki>
53
+ output = output . Replace ( "_nowiki_" , "<nowiki>" ) ;
54
+ output = output . Replace ( "_/nowiki_" , "</nowiki>" ) ;
48
55
49
56
File . Delete ( filePath ) ;
50
57
Original file line number Diff line number Diff line change 42
42
" use strict" ;
43
43
44
44
CKEDITOR .replace (" editor" , {
45
- format_tags: " p;h2;h3;h4" ,
46
45
removeButtons: " " ,
47
46
customValues: { convert_url: " /api/content.svc/ConvertContent" },
47
+ format_nowiki: { name: " No wiki" , element: " nowiki" }, // <nowiki>
48
+ format_tags: " p;h2;h3;h4;nowiki" ,
48
49
extraPlugins: " wygiwiki" ,
49
50
skin: " moono" ,
50
51
toolbar: [
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ This project is not a replacement for powerful extensions like [VisualEditor](ht
21
21
* Unsupported
22
22
* {{templates}}
23
23
* gallery
24
- * nowiki
25
24
* etc.
26
25
* Tables
27
26
* * Must* have equal rows and columns
You can’t perform that action at this time.
0 commit comments