| | @@ -16,10 +16,14 @@ |
| 16 | 16 | ############################################################################ |
| 17 | 17 | # |
| 18 | 18 | # TH1 Commands |
| 19 | 19 | # |
| 20 | 20 | |
| 21 | +set dir [file dirname [info script]] |
| 22 | + |
| 23 | +############################################################################### |
| 24 | + |
| 21 | 25 | fossil test-th-eval --open-config "setting th1-hooks" |
| 22 | 26 | set th1Hooks [expr {$RESULT eq "1"}] |
| 23 | 27 | |
| 24 | 28 | ############################################################################### |
| 25 | 29 | |
| | @@ -859,12 +863,12 @@ |
| 859 | 863 | # |
| 860 | 864 | fossil test-th-eval "info commands" |
| 861 | 865 | test th1-info-commands-1 {$RESULT eq {linecount htmlize date stime\ |
| 862 | 866 | enable_output uplevel http expr glob_match utime styleFooter catch if\ |
| 863 | 867 | tclReady searchable reinitialize combobox lindex query html anoncap randhex\ |
| 864 | | -llength for set break regexp styleHeader puts return checkout decorate\ |
| 865 | | -artifact trace wiki proc hascap globalState continue getParameter\ |
| 868 | +llength for set break regexp markdown styleHeader puts return checkout\ |
| 869 | +decorate artifact trace wiki proc hascap globalState continue getParameter\ |
| 866 | 870 | hasfeature setting lsearch breakpoint upvar render repository string unset\ |
| 867 | 871 | setParameter list error info rename anycap httpize}} |
| 868 | 872 | |
| 869 | 873 | ############################################################################### |
| 870 | 874 | |
| | @@ -1171,5 +1175,75 @@ |
| 1171 | 1175 | |
| 1172 | 1176 | ############################################################################### |
| 1173 | 1177 | |
| 1174 | 1178 | fossil test-th-eval {string is integer 0xC0DEF00Z} |
| 1175 | 1179 | test th1-string-is-31 {$RESULT eq "0"} |
| 1180 | + |
| 1181 | +############################################################################### |
| 1182 | + |
| 1183 | +fossil test-th-eval {markdown} |
| 1184 | +test th1-markdown-1 {$RESULT eq \ |
| 1185 | +{TH_ERROR: wrong # args: should be "markdown STRING"}} |
| 1186 | + |
| 1187 | +############################################################################### |
| 1188 | + |
| 1189 | +fossil test-th-eval {markdown one two} |
| 1190 | +test th1-markdown-2 {$RESULT eq \ |
| 1191 | +{TH_ERROR: wrong # args: should be "markdown STRING"}} |
| 1192 | + |
| 1193 | +############################################################################### |
| 1194 | + |
| 1195 | +fossil test-th-eval {markdown "*This is a test.*"} |
| 1196 | +test th1-markdown-3 {[normalize_result] eq {{} {<div class="markdown"> |
| 1197 | + |
| 1198 | +<p><em>This is a test.</em></p> |
| 1199 | + |
| 1200 | +</div> |
| 1201 | +}}} |
| 1202 | + |
| 1203 | +############################################################################### |
| 1204 | + |
| 1205 | +fossil test-th-eval {markdown "Test1\n=====\n*This is a test.*"} |
| 1206 | +test th1-markdown-4 {[normalize_result] eq {Test1 {<div class="markdown"> |
| 1207 | + |
| 1208 | +<h1>Test1</h1> |
| 1209 | +<p><em>This is a test.</em></p> |
| 1210 | + |
| 1211 | +</div> |
| 1212 | +}}} |
| 1213 | + |
| 1214 | +############################################################################### |
| 1215 | + |
| 1216 | +set markdown [read_file [file join $dir markdown-test1.md]] |
| 1217 | +fossil test-th-eval [string map \ |
| 1218 | + [list %markdown% $markdown] {markdown {%markdown%}}] |
| 1219 | +test th1-markdown-5 {[normalize_result] eq \ |
| 1220 | +{{Markdown Formatter Test Document} {<div class="markdown"> |
| 1221 | + |
| 1222 | +<h1>Markdown Formatter Test Document</h1> |
| 1223 | +<p>This document is designed to test the markdown formatter.</p> |
| 1224 | + |
| 1225 | +<ul> |
| 1226 | +<li>A bullet item. |
| 1227 | + |
| 1228 | +<ul> |
| 1229 | +<li>A subitem</li> |
| 1230 | +</ul></li> |
| 1231 | +<li>Second bullet</li> |
| 1232 | +</ul> |
| 1233 | + |
| 1234 | +<p>More text</p> |
| 1235 | + |
| 1236 | +<ol> |
| 1237 | +<li>Enumeration |
| 1238 | +1.1. Subitem 1 |
| 1239 | +1.2. Subitem 2</li> |
| 1240 | +<li>Second enumeration.</li> |
| 1241 | +</ol> |
| 1242 | + |
| 1243 | +<p>Another paragraph.</p> |
| 1244 | + |
| 1245 | +<h2>Other Features</h2> |
| 1246 | +<p>Text can show <em>emphasis</em> or <em>emphasis</em> or <strong>strong emphassis</strong>.</p> |
| 1247 | + |
| 1248 | +</div> |
| 1249 | +}}} |
| 1176 | 1250 | |