qwik2md 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (335) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.travis.yml +4 -0
  4. data/Gemfile +4 -0
  5. data/README.md +36 -0
  6. data/Rakefile +10 -0
  7. data/bin/console +14 -0
  8. data/bin/setup +8 -0
  9. data/exe/qwik2md +17 -0
  10. data/lib/qwik2md/version.rb +3 -0
  11. data/lib/qwik2md.rb +39 -0
  12. data/qwik2md.gemspec +30 -0
  13. data/vendor/qwik/AUTHORS +10 -0
  14. data/vendor/qwik/COPYING +340 -0
  15. data/vendor/qwik/COPYRIGHT +346 -0
  16. data/vendor/qwik/lib/qwik/Makefile +63 -0
  17. data/vendor/qwik/lib/qwik/Rakefile +17 -0
  18. data/vendor/qwik/lib/qwik/act-aa.rb +83 -0
  19. data/vendor/qwik/lib/qwik/act-archive.rb +386 -0
  20. data/vendor/qwik/lib/qwik/act-attach.rb +304 -0
  21. data/vendor/qwik/lib/qwik/act-backup.rb +236 -0
  22. data/vendor/qwik/lib/qwik/act-basic.rb +325 -0
  23. data/vendor/qwik/lib/qwik/act-book.rb +161 -0
  24. data/vendor/qwik/lib/qwik/act-calc.rb +371 -0
  25. data/vendor/qwik/lib/qwik/act-charset.rb +251 -0
  26. data/vendor/qwik/lib/qwik/act-christel.rb +112 -0
  27. data/vendor/qwik/lib/qwik/act-chronology.rb +149 -0
  28. data/vendor/qwik/lib/qwik/act-code.rb +155 -0
  29. data/vendor/qwik/lib/qwik/act-comment.rb +554 -0
  30. data/vendor/qwik/lib/qwik/act-config.rb +49 -0
  31. data/vendor/qwik/lib/qwik/act-counter.rb +125 -0
  32. data/vendor/qwik/lib/qwik/act-day.rb +96 -0
  33. data/vendor/qwik/lib/qwik/act-describe.rb +135 -0
  34. data/vendor/qwik/lib/qwik/act-diary.rb +109 -0
  35. data/vendor/qwik/lib/qwik/act-edit.rb +317 -0
  36. data/vendor/qwik/lib/qwik/act-embed-html.rb +296 -0
  37. data/vendor/qwik/lib/qwik/act-emode.rb +150 -0
  38. data/vendor/qwik/lib/qwik/act-event.rb +187 -0
  39. data/vendor/qwik/lib/qwik/act-file.rb +303 -0
  40. data/vendor/qwik/lib/qwik/act-files.rb +771 -0
  41. data/vendor/qwik/lib/qwik/act-getpass.rb +295 -0
  42. data/vendor/qwik/lib/qwik/act-history.rb +136 -0
  43. data/vendor/qwik/lib/qwik/act-html.rb +204 -0
  44. data/vendor/qwik/lib/qwik/act-httpauth.rb +147 -0
  45. data/vendor/qwik/lib/qwik/act-include.rb +142 -0
  46. data/vendor/qwik/lib/qwik/act-interwiki.rb +189 -0
  47. data/vendor/qwik/lib/qwik/act-isearch.rb +109 -0
  48. data/vendor/qwik/lib/qwik/act-keywords.rb +137 -0
  49. data/vendor/qwik/lib/qwik/act-lang.rb +81 -0
  50. data/vendor/qwik/lib/qwik/act-license.rb +63 -0
  51. data/vendor/qwik/lib/qwik/act-list.rb +287 -0
  52. data/vendor/qwik/lib/qwik/act-login.rb +410 -0
  53. data/vendor/qwik/lib/qwik/act-logout.rb +60 -0
  54. data/vendor/qwik/lib/qwik/act-mail.rb +159 -0
  55. data/vendor/qwik/lib/qwik/act-map.rb +292 -0
  56. data/vendor/qwik/lib/qwik/act-md5.rb +42 -0
  57. data/vendor/qwik/lib/qwik/act-mdlb.rb +741 -0
  58. data/vendor/qwik/lib/qwik/act-media.rb +416 -0
  59. data/vendor/qwik/lib/qwik/act-member.rb +157 -0
  60. data/vendor/qwik/lib/qwik/act-menu.rb +142 -0
  61. data/vendor/qwik/lib/qwik/act-metadata.rb +323 -0
  62. data/vendor/qwik/lib/qwik/act-mlsubmitform.rb +49 -0
  63. data/vendor/qwik/lib/qwik/act-monitor.rb +167 -0
  64. data/vendor/qwik/lib/qwik/act-new.rb +418 -0
  65. data/vendor/qwik/lib/qwik/act-pagelist.rb +248 -0
  66. data/vendor/qwik/lib/qwik/act-password.rb +145 -0
  67. data/vendor/qwik/lib/qwik/act-plan.rb +210 -0
  68. data/vendor/qwik/lib/qwik/act-povray.rb +230 -0
  69. data/vendor/qwik/lib/qwik/act-presen.rb +380 -0
  70. data/vendor/qwik/lib/qwik/act-redirect.rb +133 -0
  71. data/vendor/qwik/lib/qwik/act-ring.rb +1071 -0
  72. data/vendor/qwik/lib/qwik/act-rrefs.rb +255 -0
  73. data/vendor/qwik/lib/qwik/act-ruby.rb +116 -0
  74. data/vendor/qwik/lib/qwik/act-sample.rb +170 -0
  75. data/vendor/qwik/lib/qwik/act-save.rb +295 -0
  76. data/vendor/qwik/lib/qwik/act-schedule.rb +374 -0
  77. data/vendor/qwik/lib/qwik/act-search.rb +180 -0
  78. data/vendor/qwik/lib/qwik/act-searchwords.rb +51 -0
  79. data/vendor/qwik/lib/qwik/act-sendpass.rb +83 -0
  80. data/vendor/qwik/lib/qwik/act-site.rb +89 -0
  81. data/vendor/qwik/lib/qwik/act-sitebackup.rb +419 -0
  82. data/vendor/qwik/lib/qwik/act-sitelog.rb +118 -0
  83. data/vendor/qwik/lib/qwik/act-smil.rb +299 -0
  84. data/vendor/qwik/lib/qwik/act-status.rb +220 -0
  85. data/vendor/qwik/lib/qwik/act-style.rb +608 -0
  86. data/vendor/qwik/lib/qwik/act-table.rb +263 -0
  87. data/vendor/qwik/lib/qwik/act-tableform.rb +241 -0
  88. data/vendor/qwik/lib/qwik/act-tag.rb +103 -0
  89. data/vendor/qwik/lib/qwik/act-text.rb +70 -0
  90. data/vendor/qwik/lib/qwik/act-textarea.rb +164 -0
  91. data/vendor/qwik/lib/qwik/act-theme.rb +346 -0
  92. data/vendor/qwik/lib/qwik/act-toc.rb +112 -0
  93. data/vendor/qwik/lib/qwik/act-typekey.rb +198 -0
  94. data/vendor/qwik/lib/qwik/act-under-const.rb +94 -0
  95. data/vendor/qwik/lib/qwik/act-webservice.rb +321 -0
  96. data/vendor/qwik/lib/qwik/act-wema.rb +558 -0
  97. data/vendor/qwik/lib/qwik/act-wysiwyg.rb +238 -0
  98. data/vendor/qwik/lib/qwik/action.rb +325 -0
  99. data/vendor/qwik/lib/qwik/autoreload.rb +98 -0
  100. data/vendor/qwik/lib/qwik/bench-bench.rb +28 -0
  101. data/vendor/qwik/lib/qwik/bench-emode.rb +47 -0
  102. data/vendor/qwik/lib/qwik/bench-format-xml.rb +70 -0
  103. data/vendor/qwik/lib/qwik/bench-large-table.rb +62 -0
  104. data/vendor/qwik/lib/qwik/bench-md5.rb +14 -0
  105. data/vendor/qwik/lib/qwik/bench-module-session.rb +19 -0
  106. data/vendor/qwik/lib/qwik/bench-page.rb +50 -0
  107. data/vendor/qwik/lib/qwik/bench-s-md5.rb +28 -0
  108. data/vendor/qwik/lib/qwik/bench-session.rb +25 -0
  109. data/vendor/qwik/lib/qwik/bench-textformat.rb +31 -0
  110. data/vendor/qwik/lib/qwik/catalog-factory.rb +91 -0
  111. data/vendor/qwik/lib/qwik/catalog-ja.rb +479 -0
  112. data/vendor/qwik/lib/qwik/catalog-ml-ja.rb +145 -0
  113. data/vendor/qwik/lib/qwik/check-act-monitor.rb +112 -0
  114. data/vendor/qwik/lib/qwik/check-act-monitor2.rb +46 -0
  115. data/vendor/qwik/lib/qwik/check-act-theme.rb +27 -0
  116. data/vendor/qwik/lib/qwik/check-event.rb +112 -0
  117. data/vendor/qwik/lib/qwik/check-event2.rb +55 -0
  118. data/vendor/qwik/lib/qwik/check-htree-rexml.rb +77 -0
  119. data/vendor/qwik/lib/qwik/check-htree.rb +51 -0
  120. data/vendor/qwik/lib/qwik/check-libxml.rb +135 -0
  121. data/vendor/qwik/lib/qwik/check-many-pages.rb +47 -0
  122. data/vendor/qwik/lib/qwik/check-monitor.rb +33 -0
  123. data/vendor/qwik/lib/qwik/check-observer.rb +67 -0
  124. data/vendor/qwik/lib/qwik/check-server.rb +61 -0
  125. data/vendor/qwik/lib/qwik/check-uuencode.rb +33 -0
  126. data/vendor/qwik/lib/qwik/check-webdav.rb +65 -0
  127. data/vendor/qwik/lib/qwik/check-xml-xpath.rb +27 -0
  128. data/vendor/qwik/lib/qwik/common-backtrace.rb +94 -0
  129. data/vendor/qwik/lib/qwik/common-basic.rb +111 -0
  130. data/vendor/qwik/lib/qwik/common-condition.rb +142 -0
  131. data/vendor/qwik/lib/qwik/common-error.rb +48 -0
  132. data/vendor/qwik/lib/qwik/common-gettext.rb +50 -0
  133. data/vendor/qwik/lib/qwik/common-javascript.rb +45 -0
  134. data/vendor/qwik/lib/qwik/common-notice.rb +132 -0
  135. data/vendor/qwik/lib/qwik/common-plain.rb +105 -0
  136. data/vendor/qwik/lib/qwik/common-plugin.rb +111 -0
  137. data/vendor/qwik/lib/qwik/common-res.rb +76 -0
  138. data/vendor/qwik/lib/qwik/common-resolve.rb +92 -0
  139. data/vendor/qwik/lib/qwik/common-send.rb +171 -0
  140. data/vendor/qwik/lib/qwik/common-session.rb +139 -0
  141. data/vendor/qwik/lib/qwik/common-surface.rb +261 -0
  142. data/vendor/qwik/lib/qwik/common-url.rb +90 -0
  143. data/vendor/qwik/lib/qwik/compat/Makefile +12 -0
  144. data/vendor/qwik/lib/qwik/compat/add_load_path.rb +1 -0
  145. data/vendor/qwik/lib/qwik/config.rb +299 -0
  146. data/vendor/qwik/lib/qwik/db-b-backup.rb +142 -0
  147. data/vendor/qwik/lib/qwik/db-backup.rb +184 -0
  148. data/vendor/qwik/lib/qwik/db-berkeley.rb +306 -0
  149. data/vendor/qwik/lib/qwik/db-filesystem.rb +305 -0
  150. data/vendor/qwik/lib/qwik/db-indexer.rb +154 -0
  151. data/vendor/qwik/lib/qwik/db-searchwords.rb +238 -0
  152. data/vendor/qwik/lib/qwik/description-ja.rb +267 -0
  153. data/vendor/qwik/lib/qwik/description.rb +256 -0
  154. data/vendor/qwik/lib/qwik/dev-add-copyright.rb +23 -0
  155. data/vendor/qwik/lib/qwik/dev-backup.rb +24 -0
  156. data/vendor/qwik/lib/qwik/dev-bench.rb +175 -0
  157. data/vendor/qwik/lib/qwik/dev-calctime.rb +52 -0
  158. data/vendor/qwik/lib/qwik/dev-css-compressor.rb +60 -0
  159. data/vendor/qwik/lib/qwik/dev-extract-catalog.rb +102 -0
  160. data/vendor/qwik/lib/qwik/dev-js-compressor.rb +73 -0
  161. data/vendor/qwik/lib/qwik/dev-release.rb +235 -0
  162. data/vendor/qwik/lib/qwik/dev-replace.rb +353 -0
  163. data/vendor/qwik/lib/qwik/dev-sendmail.rb +25 -0
  164. data/vendor/qwik/lib/qwik/farm.rb +283 -0
  165. data/vendor/qwik/lib/qwik/gettext.rb +56 -0
  166. data/vendor/qwik/lib/qwik/group-cond.rb +157 -0
  167. data/vendor/qwik/lib/qwik/group-config.rb +247 -0
  168. data/vendor/qwik/lib/qwik/group-confirm.rb +147 -0
  169. data/vendor/qwik/lib/qwik/group-db.rb +326 -0
  170. data/vendor/qwik/lib/qwik/group-mail.rb +195 -0
  171. data/vendor/qwik/lib/qwik/group-member.rb +307 -0
  172. data/vendor/qwik/lib/qwik/group-sendmail.rb +231 -0
  173. data/vendor/qwik/lib/qwik/group-site.rb +374 -0
  174. data/vendor/qwik/lib/qwik/group-sweep.rb +63 -0
  175. data/vendor/qwik/lib/qwik/group.rb +157 -0
  176. data/vendor/qwik/lib/qwik/helper.rb +6 -0
  177. data/vendor/qwik/lib/qwik/html-generator.rb +104 -0
  178. data/vendor/qwik/lib/qwik/html-to-wabisabi.rb +148 -0
  179. data/vendor/qwik/lib/qwik/htree-diff.rb +87 -0
  180. data/vendor/qwik/lib/qwik/htree-format-xml.rb +57 -0
  181. data/vendor/qwik/lib/qwik/htree-generator.rb +144 -0
  182. data/vendor/qwik/lib/qwik/htree-get.rb +251 -0
  183. data/vendor/qwik/lib/qwik/htree-html-generator.rb +179 -0
  184. data/vendor/qwik/lib/qwik/htree-template.rb +263 -0
  185. data/vendor/qwik/lib/qwik/htree-to-wabisabi.rb +171 -0
  186. data/vendor/qwik/lib/qwik/loadlib.rb +79 -0
  187. data/vendor/qwik/lib/qwik/logger.rb +115 -0
  188. data/vendor/qwik/lib/qwik/mail-body.rb +171 -0
  189. data/vendor/qwik/lib/qwik/mail-header.rb +474 -0
  190. data/vendor/qwik/lib/qwik/mail-multipart.rb +193 -0
  191. data/vendor/qwik/lib/qwik/mail-parse.rb +147 -0
  192. data/vendor/qwik/lib/qwik/mail.rb +341 -0
  193. data/vendor/qwik/lib/qwik/mailaddress.rb +83 -0
  194. data/vendor/qwik/lib/qwik/mdlb-model.rb +81 -0
  195. data/vendor/qwik/lib/qwik/mdlb-sample.rb +324 -0
  196. data/vendor/qwik/lib/qwik/ml-catalog-factory.rb +27 -0
  197. data/vendor/qwik/lib/qwik/ml-exception.rb +15 -0
  198. data/vendor/qwik/lib/qwik/ml-generator.rb +28 -0
  199. data/vendor/qwik/lib/qwik/ml-gettext.rb +137 -0
  200. data/vendor/qwik/lib/qwik/ml-logger.rb +82 -0
  201. data/vendor/qwik/lib/qwik/ml-memory.rb +65 -0
  202. data/vendor/qwik/lib/qwik/ml-msg-validator.rb +86 -0
  203. data/vendor/qwik/lib/qwik/ml-processor.rb +609 -0
  204. data/vendor/qwik/lib/qwik/ml-quickml-server.rb +122 -0
  205. data/vendor/qwik/lib/qwik/ml-sendmail.rb +0 -0
  206. data/vendor/qwik/lib/qwik/ml-server.rb +107 -0
  207. data/vendor/qwik/lib/qwik/ml-session.rb +348 -0
  208. data/vendor/qwik/lib/qwik/ml-sweeper.rb +101 -0
  209. data/vendor/qwik/lib/qwik/mock-logger.rb +65 -0
  210. data/vendor/qwik/lib/qwik/mock-sendmail.rb +78 -0
  211. data/vendor/qwik/lib/qwik/mock-socket.rb +82 -0
  212. data/vendor/qwik/lib/qwik/modulobe.rb +406 -0
  213. data/vendor/qwik/lib/qwik/mongrel-server.rb +72 -0
  214. data/vendor/qwik/lib/qwik/page-files.rb +249 -0
  215. data/vendor/qwik/lib/qwik/page-generate.rb +82 -0
  216. data/vendor/qwik/lib/qwik/page-get.rb +262 -0
  217. data/vendor/qwik/lib/qwik/page-images.rb +168 -0
  218. data/vendor/qwik/lib/qwik/page-put.rb +128 -0
  219. data/vendor/qwik/lib/qwik/page-rrefs.rb +154 -0
  220. data/vendor/qwik/lib/qwik/page-title.rb +0 -0
  221. data/vendor/qwik/lib/qwik/page-wikidb.rb +234 -0
  222. data/vendor/qwik/lib/qwik/page.rb +67 -0
  223. data/vendor/qwik/lib/qwik/pages.rb +444 -0
  224. data/vendor/qwik/lib/qwik/parse-plugin.rb +249 -0
  225. data/vendor/qwik/lib/qwik/parser-emode.rb +116 -0
  226. data/vendor/qwik/lib/qwik/parser-inline.rb +272 -0
  227. data/vendor/qwik/lib/qwik/parser.rb +349 -0
  228. data/vendor/qwik/lib/qwik/password.rb +183 -0
  229. data/vendor/qwik/lib/qwik/periodic.rb +79 -0
  230. data/vendor/qwik/lib/qwik/qp.rb +56 -0
  231. data/vendor/qwik/lib/qwik/qwik-service.rb +341 -0
  232. data/vendor/qwik/lib/qwik/qwik.rb +5 -0
  233. data/vendor/qwik/lib/qwik/qwikweb-adduser.rb +34 -0
  234. data/vendor/qwik/lib/qwik/qwikweb-catalog-validator.rb +110 -0
  235. data/vendor/qwik/lib/qwik/qwikweb-incgen.rb +28 -0
  236. data/vendor/qwik/lib/qwik/qwikweb-makesite.rb +41 -0
  237. data/vendor/qwik/lib/qwik/qwikweb-server.rb +44 -0
  238. data/vendor/qwik/lib/qwik/qwikweb-showpassword.rb +26 -0
  239. data/vendor/qwik/lib/qwik/qwikweb-watchlog.rb +67 -0
  240. data/vendor/qwik/lib/qwik/request-path.rb +304 -0
  241. data/vendor/qwik/lib/qwik/request-ua.rb +76 -0
  242. data/vendor/qwik/lib/qwik/request-webrick.rb +81 -0
  243. data/vendor/qwik/lib/qwik/request.rb +91 -0
  244. data/vendor/qwik/lib/qwik/resolve-tdiary.rb +292 -0
  245. data/vendor/qwik/lib/qwik/resolve.rb +121 -0
  246. data/vendor/qwik/lib/qwik/response.rb +228 -0
  247. data/vendor/qwik/lib/qwik/server-memory.rb +57 -0
  248. data/vendor/qwik/lib/qwik/server-webrick.rb +102 -0
  249. data/vendor/qwik/lib/qwik/server.rb +252 -0
  250. data/vendor/qwik/lib/qwik/site-config.rb +149 -0
  251. data/vendor/qwik/lib/qwik/site-db.rb +136 -0
  252. data/vendor/qwik/lib/qwik/site-event.rb +162 -0
  253. data/vendor/qwik/lib/qwik/site-files.rb +86 -0
  254. data/vendor/qwik/lib/qwik/site-group.rb +103 -0
  255. data/vendor/qwik/lib/qwik/site-index.rb +47 -0
  256. data/vendor/qwik/lib/qwik/site-log.rb +64 -0
  257. data/vendor/qwik/lib/qwik/site-member.rb +230 -0
  258. data/vendor/qwik/lib/qwik/site-monitor.rb +97 -0
  259. data/vendor/qwik/lib/qwik/site-pages.rb +62 -0
  260. data/vendor/qwik/lib/qwik/site-plan.rb +139 -0
  261. data/vendor/qwik/lib/qwik/site-report.rb +282 -0
  262. data/vendor/qwik/lib/qwik/site-resolve.rb +230 -0
  263. data/vendor/qwik/lib/qwik/site-rrefs.rb +18 -0
  264. data/vendor/qwik/lib/qwik/site-search.rb +180 -0
  265. data/vendor/qwik/lib/qwik/site-timeline.rb +153 -0
  266. data/vendor/qwik/lib/qwik/site-url.rb +189 -0
  267. data/vendor/qwik/lib/qwik/site.rb +76 -0
  268. data/vendor/qwik/lib/qwik/smil-time.rb +105 -0
  269. data/vendor/qwik/lib/qwik/smtp-session.rb +331 -0
  270. data/vendor/qwik/lib/qwik/template-generator.rb +149 -0
  271. data/vendor/qwik/lib/qwik/template.rb +85 -0
  272. data/vendor/qwik/lib/qwik/test-common.rb +10 -0
  273. data/vendor/qwik/lib/qwik/test-ml-info.rb +225 -0
  274. data/vendor/qwik/lib/qwik/test-module-ml.rb +142 -0
  275. data/vendor/qwik/lib/qwik/test-module-path.rb +110 -0
  276. data/vendor/qwik/lib/qwik/test-module-public.rb +70 -0
  277. data/vendor/qwik/lib/qwik/test-module-server.rb +98 -0
  278. data/vendor/qwik/lib/qwik/test-module-session.rb +264 -0
  279. data/vendor/qwik/lib/qwik/test-module-suite.rb +91 -0
  280. data/vendor/qwik/lib/qwik/test-ms-applemail.rb +59 -0
  281. data/vendor/qwik/lib/qwik/test-ms-attach.rb +174 -0
  282. data/vendor/qwik/lib/qwik/test-ms-basic.rb +40 -0
  283. data/vendor/qwik/lib/qwik/test-ms-close.rb +35 -0
  284. data/vendor/qwik/lib/qwik/test-ms-confirm.rb +75 -0
  285. data/vendor/qwik/lib/qwik/test-ms-ignore-spam.rb +57 -0
  286. data/vendor/qwik/lib/qwik/test-ms-japanese.rb +97 -0
  287. data/vendor/qwik/lib/qwik/test-ms-jfilename.rb +82 -0
  288. data/vendor/qwik/lib/qwik/test-ms-large.rb +58 -0
  289. data/vendor/qwik/lib/qwik/test-ms-member.rb +103 -0
  290. data/vendor/qwik/lib/qwik/test-ms-multipart.rb +84 -0
  291. data/vendor/qwik/lib/qwik/test-ms-org.rb +129 -0
  292. data/vendor/qwik/lib/qwik/test-ms-plan.rb +130 -0
  293. data/vendor/qwik/lib/qwik/test-ms-post.rb +53 -0
  294. data/vendor/qwik/lib/qwik/test-ms-quopri.rb +76 -0
  295. data/vendor/qwik/lib/qwik/test-sub-quopri.rb +45 -0
  296. data/vendor/qwik/lib/qwik/test-submit-base64.rb +59 -0
  297. data/vendor/qwik/lib/qwik/test-submit-forward.rb +61 -0
  298. data/vendor/qwik/lib/qwik/test-submit-html-mail.rb +52 -0
  299. data/vendor/qwik/lib/qwik/test-submit-japanese.rb +135 -0
  300. data/vendor/qwik/lib/qwik/test-submit-jfilename.rb +144 -0
  301. data/vendor/qwik/lib/qwik/test-submit-uuencode.rb +71 -0
  302. data/vendor/qwik/lib/qwik/test-suite-all.rb +8 -0
  303. data/vendor/qwik/lib/qwik/test-suite-basic.rb +9 -0
  304. data/vendor/qwik/lib/qwik/test-suite-ml.rb +9 -0
  305. data/vendor/qwik/lib/qwik/test-typekey.rb +64 -0
  306. data/vendor/qwik/lib/qwik/testunit.rb +45 -0
  307. data/vendor/qwik/lib/qwik/tokenizer-inline.rb +288 -0
  308. data/vendor/qwik/lib/qwik/tokenizer.rb +331 -0
  309. data/vendor/qwik/lib/qwik/typekey.rb +160 -0
  310. data/vendor/qwik/lib/qwik/util-basic.rb +135 -0
  311. data/vendor/qwik/lib/qwik/util-charset.rb +331 -0
  312. data/vendor/qwik/lib/qwik/util-css.rb +56 -0
  313. data/vendor/qwik/lib/qwik/util-csv-tokenizer.rb +113 -0
  314. data/vendor/qwik/lib/qwik/util-filename.rb +112 -0
  315. data/vendor/qwik/lib/qwik/util-pathname.rb +202 -0
  316. data/vendor/qwik/lib/qwik/util-pid.rb +58 -0
  317. data/vendor/qwik/lib/qwik/util-safe.rb +67 -0
  318. data/vendor/qwik/lib/qwik/util-sendmail.rb +273 -0
  319. data/vendor/qwik/lib/qwik/util-string.rb +202 -0
  320. data/vendor/qwik/lib/qwik/util-time.rb +125 -0
  321. data/vendor/qwik/lib/qwik/util-webrick.rb +176 -0
  322. data/vendor/qwik/lib/qwik/version.rb +11 -0
  323. data/vendor/qwik/lib/qwik/wabisabi-basic.rb +163 -0
  324. data/vendor/qwik/lib/qwik/wabisabi-diff.rb +130 -0
  325. data/vendor/qwik/lib/qwik/wabisabi-format-xml.rb +310 -0
  326. data/vendor/qwik/lib/qwik/wabisabi-generator.rb +262 -0
  327. data/vendor/qwik/lib/qwik/wabisabi-index.rb +174 -0
  328. data/vendor/qwik/lib/qwik/wabisabi-table.rb +212 -0
  329. data/vendor/qwik/lib/qwik/wabisabi-template.rb +295 -0
  330. data/vendor/qwik/lib/qwik/wabisabi-to-htree.rb +111 -0
  331. data/vendor/qwik/lib/qwik/wabisabi-to-wiki.rb +690 -0
  332. data/vendor/qwik/lib/qwik/wabisabi-traverse.rb +207 -0
  333. data/vendor/qwik/lib/qwik/wabisabi-validator.rb +116 -0
  334. data/vendor/qwik/lib/qwik/wabisabi.rb +5 -0
  335. metadata +492 -0
@@ -0,0 +1,690 @@
1
+ # Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
2
+ # This is free software with ABSOLUTELY NO WARRANTY.
3
+ # You can redistribute it and/or modify it under the terms of the GNU GPL 2.
4
+
5
+ $LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
6
+ require 'qwik/util-string'
7
+
8
+ module Qwik
9
+ class WabisabiToWiki
10
+ def self.translate(wabisabi)
11
+ str = parse(wabisabi)
12
+ str.gsub!(/\n\n\z/, "\n")
13
+ return str
14
+ end
15
+
16
+ private
17
+
18
+ def self.parse(wabisabi)
19
+ if wabisabi.is_a?(Array)
20
+ first = wabisabi[0]
21
+
22
+ if first.nil?
23
+ return ''
24
+ end
25
+
26
+ if first.is_a?(String)
27
+ if first == "\n"
28
+ str = ''
29
+ else
30
+ str = first
31
+ end
32
+ str += parse(wabisabi[1..-1])
33
+ return str
34
+ end
35
+
36
+ if first.is_a?(Array)
37
+ return wabisabi.map {|a|
38
+ parse(a)
39
+ }.join
40
+ end
41
+
42
+ if first.is_a?(Symbol)
43
+ # FIXME: Should take care for inline level element.
44
+ return parse_block(wabisabi)
45
+ end
46
+
47
+ p 'What? ', wabisabi; raise
48
+ end
49
+
50
+ if wabisabi.is_a?(String)
51
+ if wabisabi == "\n"
52
+ return ''
53
+ else
54
+ return wabisabi
55
+ end
56
+ end
57
+
58
+ p 'What? ', wabisabi; raise
59
+ end
60
+
61
+ SIMPLE_BLOCK = {
62
+ :h2 => ['* ', "\n"],
63
+ :h3 => ['** ', "\n"],
64
+ :h4 => ['*** ', "\n"],
65
+ :h5 => ['**** ', "\n"],
66
+ :h6 => ['***** ', "\n"],
67
+ :p => ['', "\n\n"],
68
+ }
69
+
70
+ # ==================== block level
71
+ def self.parse_block(e)
72
+ if SIMPLE_BLOCK[e[0]]
73
+ head, tail = SIMPLE_BLOCK[e[0]]
74
+ str = head + parse_span(e.inside) + tail
75
+ return str
76
+ end
77
+
78
+ case e[0]
79
+
80
+ when :dl
81
+ return parse_dl(e)
82
+
83
+ when :ul
84
+ return parse_ul(e)
85
+
86
+ when :ol
87
+ return parse_ol(e)
88
+
89
+ when :blockquote
90
+ return parse_blockquote(e)
91
+
92
+ when :pre
93
+ return parse_pre(e)
94
+
95
+ when :table
96
+ return parse_table(e)
97
+
98
+ when :plugin
99
+ return parse_plugin(e)
100
+
101
+ when :html, :div
102
+ return parse(e.inside)
103
+
104
+ when :hr
105
+ return "====\n"
106
+
107
+ end
108
+
109
+ # maybe, inline element.
110
+ return parse_span(e)
111
+ #p 'What? ', e; raise
112
+ end
113
+
114
+ def self.parse_dl(elem)
115
+ str = ''
116
+ in_dt = false
117
+ elem.each_child {|e|
118
+ next if e == "\n"
119
+ if e[0] == :dt
120
+ span = parse_span(e.inside)
121
+ span.sub!(/\n+\z/, '')
122
+ str << ':'+span
123
+ in_dt = true
124
+ elsif e[0] == :dd
125
+ str << ':' if ! in_dt
126
+ span = parse_span(e.inside)
127
+ span.sub!(/\n+\z/, '')
128
+ str << ':'+span+"\n"
129
+ in_dt = false
130
+ else
131
+ p 'What? ', e; raise
132
+ end
133
+ }
134
+ return str
135
+ end
136
+
137
+ def self.parse_ul(elem)
138
+ return parse_list('-', :ul, elem)
139
+ end
140
+
141
+ def self.parse_ol(elem)
142
+ return parse_list('+', :ol, elem)
143
+ end
144
+
145
+ def self.parse_list(prefix, elementname, elem)
146
+ str = ''
147
+ elem.each_child {|e|
148
+ next if e == "\n"
149
+
150
+ if e[0] == :li
151
+ inside = e.inside
152
+ instr = parse(inside)
153
+ nstr = ''
154
+ instr.each_line {|line|
155
+ next if line == "\n"
156
+ line = line.normalize_eol
157
+ str << prefix + line
158
+ }
159
+
160
+ elsif e[0] == elementname
161
+ nstr = parse_ul(e)
162
+ nstr.each_line {|line|
163
+ next if line == "\n"
164
+ line = line.normalize_eol
165
+ str << prefix + line
166
+ }
167
+ else
168
+ p 'What? ', e
169
+ end
170
+ }
171
+ return str
172
+ end
173
+
174
+ def self.parse_blockquote(elem)
175
+ str = parse(elem.inside)
176
+ nstr = ''
177
+ str.each {|line|
178
+ next if line == "\n"
179
+ nstr << "> #{line}"
180
+ }
181
+ return nstr
182
+ end
183
+
184
+ def self.parse_pre(elem)
185
+ str = ''
186
+ elem.inside.each {|e|
187
+ if e.is_a?(String)
188
+ str << e
189
+ else
190
+ p 'What? ', e; raise
191
+ end
192
+ }
193
+
194
+ nstr = ''
195
+ str.each {|line|
196
+ next if line == "\n"
197
+ line = line.normalize_eol
198
+ nstr << " #{line}"
199
+ }
200
+ return nstr
201
+ end
202
+
203
+ def self.parse_table(elem)
204
+ str = ''
205
+ elem.each_child {|e|
206
+ next if e == "\n"
207
+ if e[0] == :tr
208
+ str << "#{parse_tr(e)}\n"
209
+ elsif e[0] == :tbody
210
+ str << parse_table(e.inside)
211
+ else
212
+ p 'What? ', e; raise
213
+ end
214
+ }
215
+ return str
216
+ end
217
+
218
+ def self.parse_tr(elem)
219
+ str = ''
220
+ elem.each_child {|e|
221
+ next if e == "\n"
222
+ if e[0] == :td
223
+ str << "|#{parse_span(e.inside)}"
224
+ else
225
+ p 'What? ', e; raise
226
+ end
227
+ }
228
+ return str
229
+ end
230
+
231
+ def self.parse_plugin(e)
232
+ param = e.attr[:param]
233
+ method = e.attr[:method]
234
+ data = e.text
235
+ str = ''
236
+ str << "{{#{method}"
237
+ str << "(#{param})" if param && ! param.empty?
238
+ if data && ! data.empty?
239
+ str << "\n"
240
+ data = data.normalize_eol
241
+ str << data
242
+ end
243
+ str << "}}\n"
244
+ return str
245
+ end
246
+
247
+ # ==================== inline level
248
+ def self.parse_span(elem)
249
+ str = ''
250
+
251
+ if elem.is_a?(Array) && elem[0].is_a?(Symbol)
252
+ return parse_span_elem(elem)
253
+ end
254
+
255
+ elem.each_child {|e|
256
+ if e.is_a?(String)
257
+ str << e
258
+ elsif e.is_a?(Array)
259
+ str << parse_span_elem(e)
260
+ else
261
+ p 'What? ', e
262
+ end
263
+ }
264
+ str
265
+ end
266
+
267
+ def self.parse_span_elem(e)
268
+ n = e[0]
269
+
270
+ case n
271
+
272
+ when :a
273
+ return parse_a(e)
274
+
275
+ when :img
276
+ attr = e.attr
277
+ return '' if attr.nil?
278
+ src = attr[:src]
279
+ return '' if src.nil?
280
+ return "[[#{src}]]"
281
+
282
+ when :em
283
+ return "''#{parse_span(e.inside)}''"
284
+
285
+ when :strong
286
+ return "'''#{parse_span(e.inside)}'''"
287
+
288
+ when :del
289
+ return "==#{parse_span(e.inside)}=="
290
+
291
+ when :br
292
+ return "{{br}}\n"
293
+
294
+ else
295
+ return ''
296
+ #p 'What? ', e; raise
297
+ end
298
+ end
299
+
300
+ def self.parse_a(e)
301
+ href = e.attr[:href]
302
+
303
+ if /\A(.+)\.html\z/ =~ href
304
+ href = $1
305
+ end
306
+
307
+ text = e.text
308
+ str = ''
309
+ str << "[[#{text}"
310
+ if href != text
311
+ str << "|#{href}"
312
+ end
313
+ str << ']]'
314
+ return str
315
+ end
316
+ end
317
+ end
318
+
319
+ if $0 == __FILE__
320
+ require 'qwik/testunit'
321
+ require 'qwik/html-to-wabisabi'
322
+ $test = true
323
+ end
324
+
325
+ if defined?($test) && $test
326
+ class TestWabisabiToWiki < Test::Unit::TestCase
327
+ # In this situation, I use reverse order argument for covinience.
328
+ def ok(w, e)
329
+ ok_eq(e, Qwik::WabisabiToWiki.translate(w))
330
+ end
331
+
332
+ def test_from_parser
333
+ # test none
334
+ ok([], '')
335
+ #ok([["\n"]], "#t")
336
+
337
+ # test p
338
+ ok([[:p, 't']], "t\n")
339
+ ok([[:p, 's', "\n", 't']], "s\nt\n")
340
+ ok([[:p, 's'], ["\n"], [:p, 't']], "s\n\nt\n")
341
+ ok([[:p, 's', [:br], 't']], "s{{br}}\nt\n")
342
+
343
+ ok([[:dl, [:dt, 'dt1'], [:dd, 'dd1']], [:p, 'p1'],
344
+ [:dl, [:dd, 'dd2']]], ":dt1:dd1\np1\n\n::dd2\n")
345
+
346
+ # test header
347
+ ok([[:h2, 't']], "* t\n")
348
+ ok([[:h2, 't'], [:p, 't']], "* t\nt\n")
349
+ ok([[:h3, 't']], "** t\n")
350
+ ok([[:h4, 't']], "*** t\n")
351
+ ok([[:h5, 't']], "**** t\n")
352
+ ok([[:h6, 't']], "***** t\n")
353
+ ok([[:h6, '*t']], "***** *t\n")
354
+ ok([[:h6, '**t']], "***** **t\n")
355
+
356
+ # test_ignore_space
357
+ ok([[:h2, 't']], "* t\n")
358
+ ok([[:h2, 't']], "* t\n")
359
+ ok([[:h2, 't']], "* t\n")
360
+ ok([[:h3, 't']], "** t\n")
361
+ ok([[:h3, 't']], "** t\n")
362
+ ok([[:h3, 't']], "** t\n")
363
+
364
+ # test listing
365
+ ok([[:ul, [:li, 't']]], "-t\n")
366
+ ok([[:ul, [:ul, [:li, 't']]]], "--t\n")
367
+ ok([[:ul, [:ul, [:ul, [:li, 't']]]]], "---t\n")
368
+ ok([[:ul, [:li, 't']], [:p, 't']], "-t\nt\n")
369
+ ok([[:ul, [:li, 't'], [:li, 't']]], "-t\n-t\n")
370
+ ok([[:ul, [:li, 't'], [:ul, [:li, 't']]]], "-t\n--t\n")
371
+ ok([[:ul, [:ul, [:li, 't']], [:li, 't']]], "--t\n-t\n")
372
+ ok([[:ul, [:ul, [:li, 't']], [:li, 't'], [:ul, [:li, 't']]]],
373
+ "--t\n-t\n--t\n")
374
+ ok([[:ol, [:li, 't']]], "+t\n")
375
+ ok([[:ul, [:li, 't']], [:ol, [:li, 't']]], "-t\n+t\n")
376
+ ok([[:ul, [:li, 't1']], ["\n"], [:ul, [:li, 't2']]], "-t1\n-t2\n")
377
+ ok([["\n"], [:ul, [:li, 't1'], [:li, 't2']]], "-t1\n-t2\n")
378
+
379
+ # test blockquote
380
+ ok([[:blockquote, [:p, 't']]], "> t\n")
381
+ ok([[:blockquote, [:p, 's', "\n", 't']]], "> s\n> t\n")
382
+ ok([[:blockquote, [:ul, [:li, 's'], [:li, 't']]]], "> -s\n> -t\n")
383
+
384
+ # test dl
385
+ ok([[:dl, [:dt, 'dt'],[:dd, 'dd']]], ":dt:dd\n")
386
+ ok([[:dl, [:dt, 'dt']]], ':dt')
387
+ ok([[:dl]], '')
388
+ ok([[:dl]], '')
389
+ ok([[:dl, [:dd, 'dd']]], "::dd\n")
390
+ ok([[:dl, [:dt, 'dt'], [:dd, 'dd'], [:dt, 'dt2'], [:dd, 'dd2']]],
391
+ ":dt:dd\n:dt2:dd2\n")
392
+ ok([[:dl, [:dt, 'dt'], [:dd, 'dd'], [:dd, 'dd2']]], ":dt:dd\n::dd2\n")
393
+
394
+ # test pre
395
+ ok([[:pre, 't']], " t\n")
396
+ ok([[:pre, "s\nt"]], " s\n t\n")
397
+ ok([[:pre, "s\n"]], " s\n")
398
+ ok([[:pre, "s\nt\n"]], " s\n t\n")
399
+ ok([[:pre, 't1'], ["\n"], [:pre, 't2']], " t1\n t2\n")
400
+
401
+ # test_table
402
+ ok([[:table, [:tr, [:td, 't']]]], "|t\n")
403
+ ok([[:table, [:tr, [:td, 't1'], [:td, 't2']]]], "|t1|t2\n")
404
+ ok([[:table, [:tr, [:td, ''], [:td, 't2']]]], "||t2\n")
405
+ ok([[:table, [:tr, [:td, 's']], [:tr, [:td, 't']]]], "|s\n|t\n")
406
+ ok([[:table, [:tr, [:td, 's1'], [:td, 's2']],
407
+ [:tr, [:td, 't1'], [:td, 't2']]]], "|s1|s2\n|t1|t2\n")
408
+
409
+ # test plugin
410
+ ok([[:plugin, {:method=>'t', :param=>''}]], "{{t}}\n")
411
+ ok([[:plugin, {:method=>'t', :param=>'a'}]], "{{t(a)}}\n")
412
+ ok([[:plugin, {:method=>'t', :param=>''}, "s\n"]], "{{t\ns\n}}\n")
413
+ ok([[:plugin, {:method=>'t', :param=>''}, "s1\ns2\n"]],
414
+ "{{t\ns1\ns2\n}}\n")
415
+
416
+ # test_multiline
417
+ ok([[:p, 's', "\n", 't']], "s\nt\n")
418
+ ok([[:p, 's', [:br], 't']], "s{{br}}\nt\n")
419
+ ok([[:p, 's'], ["\n"], [:p, 't']], "s\n\nt\n")
420
+ ok([[:p, 's', [:br], [:br], 't']], "s{{br}}\n{{br}}\nt\n")
421
+
422
+ str0 = "
423
+ p1~
424
+ ~
425
+ > b1~
426
+ > b2~
427
+ > ~
428
+ > > bb1~
429
+ > > bb2~
430
+ > ~
431
+ > b3~
432
+ > b4~
433
+ ~
434
+ p2~
435
+ "
436
+
437
+ str = "p1
438
+
439
+ > b1{{br}}
440
+ > b2
441
+ > > bb1{{br}}
442
+ > > bb2
443
+ > b3{{br}}
444
+ > b4
445
+ p2
446
+ "
447
+ ok([[:p, 'p1'],
448
+ [:blockquote, [:p, 'b1', [:br], 'b2'],
449
+ [:blockquote, [:p, 'bb1', [:br], 'bb2']],
450
+ [:p, 'b3', [:br], 'b4']],
451
+ [:p, 'p2']],
452
+ str)
453
+
454
+ # test_html
455
+ ok([[:html, "t\n"]], "t\n")
456
+ ok([[:div, {:class=>'error'}, 'can not use [script]']],
457
+ 'can not use [script]')
458
+
459
+ # test_ref
460
+ ok([[:ul, [:li, [:a, {:href=>'http://e.com/'}, 't']]]],
461
+ "-[[t|http://e.com/]]\n")
462
+
463
+ # test_hr
464
+ ok([[:hr]], "====\n")
465
+
466
+ # test_bug
467
+ ok_eq("\226]", '望')
468
+ ok([[:p, [:a, {:href=>"\226].html"}, "\226]"]]], '[[望]]'+"\n")
469
+ end
470
+ end
471
+
472
+ class TestWabisabiToWiki_wiki < Test::Unit::TestCase
473
+ def ok(e, html)
474
+ # $KCODE = 's'
475
+ w = Qwik::HtmlToWabisabi.parse(html)
476
+ wiki = Qwik::WabisabiToWiki.translate(w)
477
+ ok_eq(e, wiki)
478
+ end
479
+
480
+ def test_dl
481
+ s = '<DL>
482
+ <DT>Wiki
483
+ <DD>書き込み可能なWebページ
484
+ <DT>QuickML
485
+ <DD>簡単に作れるメーリングリストシステム</DD></DL>
486
+ '
487
+ e = ':Wiki:書き込み可能なWebページ
488
+ :QuickML:簡単に作れるメーリングリストシステム
489
+ '
490
+ ok(e, s)
491
+ end
492
+
493
+ def test_ul
494
+ s = '<UL>
495
+ <LI>箇条書レベル1
496
+ <UL>
497
+ <LI>箇条書レベル2
498
+ <UL>
499
+ <LI>箇条書レベル3</LI></UL></LI></UL></LI></UL>
500
+ '
501
+ e = '-箇条書レベル1
502
+ --箇条書レベル2
503
+ ---箇条書レベル3
504
+ '
505
+ ok(e, s)
506
+ end
507
+
508
+ def test_blockquote
509
+ s = '<BLOCKQUOTE>
510
+ <P>引用。</P></BLOCKQUOTE>
511
+ '
512
+ e = "> 引用。\n"
513
+ ok(e, s)
514
+ end
515
+
516
+ def test_basic
517
+ # test div
518
+ ok("* h\n", '<H2>h</H2>')
519
+ ok("** h\n", '<H3>h</H3>')
520
+ ok("p\n", '<P>p</P>')
521
+ ok("p\n\np2\n", '<P>p</P><P>p2</P>')
522
+ #ok('', '<UL><LI>li</LI></UL>')
523
+ #ok('', '<UL><LI>li1</LI><UL><LI>li2</LI></UL></UL>')
524
+ #ok('', '<DL><DT>dt<DD>dd</DD></DL>')
525
+ #ok('', '<DL><DT>dt1<DD>dd1><DT>dt2<DD>dd2</DD></DL>')
526
+ ok("> 引用。\n", '<BLOCKQUOTE><P>引用。</P></BLOCKQUOTE>')
527
+ ok("> * h\n", '<BLOCKQUOTE><H2>h</H2></BLOCKQUOTE>')
528
+ ok("> x\n> y\n", '<BLOCKQUOTE><P>x</P><P>y</P></BLOCKQUOTE>')
529
+
530
+ # test span
531
+ ok("Go [[FrontPage]].\n",
532
+ '<P>Go <A href="FrontPage.html">FrontPage</A>.</P>')
533
+ ok("Go [[qwikWeb|http://example.com/]].\n",
534
+ '<P>Go <A href="http://example.com/">qwikWeb</A>.</P>')
535
+ ok("''強調''、'''さらに強調'''、==取り消し線==\n",
536
+ '<P><EM>強調</EM>、<STRONG>さらに強調</STRONG>、<DEL>取り消し線</DEL></P>')
537
+ ok("[[http://example.com/.theme/new.png]]\n",
538
+ '<P><IMG alt=new src="http://example.com/.theme/new.png"></P>')
539
+ ok("\n", '<P><IMG></P>')
540
+ ok("[[FrontPage]] [[Yahoo!|http://www.yahoo.co.jp/]]\n\n{{recent(1)}}\n", '<P><A href="FrontPage.html">FrontPage</A> <A href="http://www.yahoo.co.jp/">Yahoo!</A></P><PLUGIN param="1" method="recent"></PLUGIN>')
541
+ end
542
+
543
+ def test_frontpage
544
+ s = '<H2>FrontPage</H2>
545
+ <P>これは新規qwikWebサイトの入口となるページです。</P>
546
+ <H3>使い方</H3>
547
+ <P>ページの上の方にある「編集」というリンクをたどると、このページの編集モードになります。</P>
548
+ <P>表示されたテキストの内容を変更し、「Save」ボタンをクリックすると、このページの内容が変更されます。</P>
549
+ <H3>記述方法</H3>
550
+ <P>ページの内容はテキストで書かれており、いくつかの記号によって見出しなどの指定をします。詳しい情報は、<A href="TextFormat.html">TextFormat</A>をご覧下さい。</P>
551
+ <H3>qwikWeb</H3>
552
+ <P>詳しくは、<A href="http://example.com/">qwikWeb</A>ホームページをご覧ください。</P>
553
+ '
554
+ org = '* FrontPage
555
+ これは新規qwikWebサイトの入口となるページです。
556
+
557
+ ** 使い方
558
+ ページの上の方にある「編集」というリンクをたどると、
559
+ このページの編集モードになります。
560
+
561
+ 表示されたテキストの内容を変更し、「Save」ボタンをクリックすると、
562
+ このページの内容が変更されます。
563
+
564
+ ** 記述方法
565
+ ページの内容はテキストで書かれており、
566
+ いくつかの記号によって見出しなどの指定をします。
567
+ 詳しい情報は、[[TextFormat]]をご覧下さい。
568
+
569
+ ** qwikWeb
570
+ 詳しくは、[[qwikWeb|http://example.com/]]ホームページをご覧ください。
571
+ '
572
+ e = '* FrontPage
573
+ これは新規qwikWebサイトの入口となるページです。
574
+
575
+ ** 使い方
576
+ ページの上の方にある「編集」というリンクをたどると、このページの編集モードになります。
577
+
578
+ 表示されたテキストの内容を変更し、「Save」ボタンをクリックすると、このページの内容が変更されます。
579
+
580
+ ** 記述方法
581
+ ページの内容はテキストで書かれており、いくつかの記号によって見出しなどの指定をします。詳しい情報は、[[TextFormat]]をご覧下さい。
582
+
583
+ ** qwikWeb
584
+ 詳しくは、[[qwikWeb|http://example.com/]]ホームページをご覧ください。
585
+ '
586
+ ok(e, s)
587
+ end
588
+
589
+ def test_textformat
590
+ s = '<H2>書式一覧簡易版</H2>
591
+ <P>詳細な説明は<A href="TextFormat.html">TextFormat</A>をごらんください。</P>
592
+ <H3>見出し2</H3>
593
+ <H4>見出し3</H4>
594
+ <H5>見出し4</H5>
595
+ <H6>見出し5</H6>
596
+ <UL>
597
+ <LI>箇条書レベル1
598
+ <UL>
599
+ <LI>箇条書レベル2
600
+ <UL>
601
+ <LI>箇条書レベル3</LI></UL></LI></UL></LI></UL>
602
+ <OL>
603
+ <LI>順序リスト1
604
+ <OL>
605
+ <LI>順序リスト2
606
+ <OL>
607
+ <LI>順序リスト3</LI></OL></LI></OL></LI></OL><PRE>整形済みテキスト。</PRE>
608
+ <BLOCKQUOTE>
609
+ <P>引用。</P></BLOCKQUOTE>
610
+ <DL>
611
+ <DT>Wiki
612
+ <DD>書き込みできるWebページ
613
+ <DT>QuickML
614
+ <DD>簡単に作れるメーリングリストシステム</DD></DL>
615
+ <TABLE>
616
+ <TBODY>
617
+ <TR>
618
+ <TD>項目1-1</TD>
619
+ <TD>項目1-2</TD>
620
+ <TD>項目1-3</TD></TR>
621
+ <TR>
622
+ <TD>項目2-1</TD>
623
+ <TD>項目2-2</TD>
624
+ <TD>項目2-3</TD></TR></TBODY></TABLE>
625
+ <P><EM>強調</EM>、<STRONG>さらに強調</STRONG>、<DEL>取り消し線</DEL> <IMG alt=new src="http://example.com/.theme/new.png"> <A href="FrontPage.html">FrontPage</A> <A href="http://www.yahoo.co.jp/">Yahoo!</A></P><PLUGIN param="1" method="recent"></PLUGIN>
626
+ '
627
+ org = "* 書式一覧簡易版
628
+ 詳細な説明は[[TextFormat]]をごらんください。
629
+ ** 見出し2
630
+ *** 見出し3
631
+ **** 見出し4
632
+ ***** 見出し5
633
+ - 箇条書レベル1
634
+ -- 箇条書レベル2
635
+ --- 箇条書レベル3
636
+ + 順序リスト1
637
+ ++ 順序リスト2
638
+ +++ 順序リスト3
639
+ 整形済みテキスト。
640
+ > 引用。
641
+ :Wiki:書き込みできるWebページ
642
+ :QuickML:簡単に作れるメーリングリストシステム
643
+ ,項目1-1,項目1-2,項目1-3
644
+ ,項目2-1,項目2-2,項目2-3
645
+ ''強調''、'''さらに強調'''、==取り消し線==
646
+ [[new|http://example.com/.theme/new.png]]
647
+ [[FrontPage]]
648
+ [[Yahoo!|http://www.yahoo.co.jp/]]
649
+ {{recent(1)}}
650
+ "
651
+ e = "* 書式一覧簡易版
652
+ 詳細な説明は[[TextFormat]]をごらんください。
653
+
654
+ ** 見出し2
655
+ *** 見出し3
656
+ **** 見出し4
657
+ ***** 見出し5
658
+ -箇条書レベル1
659
+ --箇条書レベル2
660
+ ---箇条書レベル3
661
+ +順序リスト1
662
+ ++順序リスト2
663
+ +++順序リスト3
664
+ 整形済みテキスト。
665
+ > 引用。
666
+ :Wiki:書き込みできるWebページ
667
+ :QuickML:簡単に作れるメーリングリストシステム
668
+ |項目1-1|項目1-2|項目1-3
669
+ |項目2-1|項目2-2|項目2-3
670
+ ''強調''、'''さらに強調'''、==取り消し線== [[http://example.com/.theme/new.png]] [[FrontPage]] [[Yahoo!|http://www.yahoo.co.jp/]]
671
+
672
+ {{recent(1)}}
673
+ "
674
+ ok(e, s)
675
+ end
676
+
677
+ def test_bug
678
+ s = '<DL>
679
+ <DT>Wiki
680
+ <DD>書き込みできる<STRONG>Web</STRONG>ページ
681
+ <DT>QuickML
682
+ <DD><EM>簡単</EM>に作れるメーリングリストシステム</DD></DL>
683
+ '
684
+ e = ":Wiki:書き込みできる'''Web'''ページ
685
+ :QuickML:''簡単''に作れるメーリングリストシステム
686
+ "
687
+ ok(e, s)
688
+ end
689
+ end
690
+ end