git.iko.soy/typeable/pandoc
on master help sign in
Use style attributes rather than css classes for strikethrough and ordered list styles.

This works better when fragments, rather than standalone documents, are generated. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1245 788f1e2b-df1e-0410-8736-df70ead52e1b

commit839f77d81ecd742d6368f8b140eeccd37d8a80e7 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 24 Feb 2008, 18:15 (19 years ago) parent858269d
2 files changed+21−37
Text/Pandoc/Writers/HTML.hs+3−10 tests/writer.html+18−27
Text/Pandoc/Writers/HTML.hs+3−10
@@ -331,13 +331,8 @@ blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do
331331 then [start startnum]
332332 else []) ++
333333 (if numstyle /= DefaultStyle
334− then [theclass numstyle']
334+ then [thestyle $ "list-style-type: " ++ numstyle' ++ ";"]
335335 else [])
336− if numstyle /= DefaultStyle
337− then addToCSS $ "ol." ++ numstyle' ++
338− " { list-style-type: " ++
339− numstyle' ++ "; }"
340− else return ()
341336 return $ ordList ! attribs $ contents
342337blockToHtml opts (DefinitionList lst) = do
343338 contents <- mapM (\(term, def) -> do term' <- inlineListToHtml opts term
@@ -405,10 +400,8 @@ inlineToHtml opts inline =
405400 (Emph lst) -> inlineListToHtml opts lst >>= return . emphasize
406401 (Strong lst) -> inlineListToHtml opts lst >>= return . strong
407402 (Code str) -> return $ thecode << str
408− (Strikeout lst) -> addToCSS
409− ".strikeout { text-decoration: line-through; }" >>
410− inlineListToHtml opts lst >>=
411− return . (thespan ! [theclass "strikeout"])
403+ (Strikeout lst) -> inlineListToHtml opts lst >>=
404+ return . (thespan ! [thestyle "text-decoration: line-through;"])
412405 (Superscript lst) -> inlineListToHtml opts lst >>= return . sup
413406 (Subscript lst) -> inlineListToHtml opts lst >>= return . sub
414407 (Quoted quoteType lst) ->
tests/writer.html+18−27
@@ -8,16 +8,7 @@
88 /><meta name="author" content="John MacFarlane"
99 /><meta name="author" content="Anonymous"
1010 /><meta name="date" content="July 17, 2006"
11− /><style type="text/css"
12− >
13−.strikeout { text-decoration: line-through; }
14−ol.decimal { list-style-type: decimal; }
15−ol.lower-alpha { list-style-type: lower-alpha; }
16−ol.lower-roman { list-style-type: lower-roman; }
17−ol.upper-alpha { list-style-type: upper-alpha; }
18−ol.upper-roman { list-style-type: upper-roman; }
19−</style
20− ></head
11+ /></head
2112 ><body
2213 ><h1 class="title"
2314 >Pandoc Test Suite</h1
@@ -85,7 +76,7 @@ ol.upper-roman { list-style-type: upper-roman; }
8576 ></pre
8677 ><p
8778 >A list:</p
88− ><ol class="decimal"
79+ ><ol style="list-style-type: decimal;"
8980 ><li
9081 >item one</li
9182 ><li
@@ -218,7 +209,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
218209 >Ordered</h2
219210 ><p
220211 >Tight:</p
221− ><ol class="decimal"
212+ ><ol style="list-style-type: decimal;"
222213 ><li
223214 >First</li
224215 ><li
@@ -228,7 +219,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
228219 ></ol
229220 ><p
230221 >and:</p
231− ><ol class="decimal"
222+ ><ol style="list-style-type: decimal;"
232223 ><li
233224 >One</li
234225 ><li
@@ -238,7 +229,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
238229 ></ol
239230 ><p
240231 >Loose using tabs:</p
241− ><ol class="decimal"
232+ ><ol style="list-style-type: decimal;"
242233 ><li
243234 ><p
244235 >First</p
@@ -254,7 +245,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
254245 ></ol
255246 ><p
256247 >and using spaces:</p
257− ><ol class="decimal"
248+ ><ol style="list-style-type: decimal;"
258249 ><li
259250 ><p
260251 >One</p
@@ -270,7 +261,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
270261 ></ol
271262 ><p
272263 >Multiple paragraphs:</p
273− ><ol class="decimal"
264+ ><ol style="list-style-type: decimal;"
274265 ><li
275266 ><p
276267 >Item 1, graf one.</p
@@ -302,7 +293,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
302293 ></ul
303294 ><p
304295 >Here&rsquo;s another:</p
305− ><ol class="decimal"
296+ ><ol style="list-style-type: decimal;"
306297 ><li
307298 >First</li
308299 ><li
@@ -320,7 +311,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
320311 ></ol
321312 ><p
322313 >Same thing but with paragraphs:</p
323− ><ol class="decimal"
314+ ><ol style="list-style-type: decimal;"
324315 ><li
325316 ><p
326317 >First</p
@@ -366,7 +357,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
366357 ></ul
367358 ><h2 id="fancy-list-markers"
368359 >Fancy list markers</h2
369− ><ol start="2" class="decimal"
360+ ><ol start="2" style="list-style-type: decimal;"
370361 ><li
371362 >begins with 2</li
372363 ><li
@@ -374,11 +365,11 @@ These should not be escaped: \$ \\ \&gt; \[ \{
374365 >and now 3</p
375366 ><p
376367 >with a continuation</p
377− ><ol start="4" class="lower-roman"
368+ ><ol start="4" style="list-style-type: lower-roman;"
378369 ><li
379370 >sublist with roman numerals, starting with 4</li
380371 ><li
381− >more items<ol class="upper-alpha"
372+ >more items<ol style="list-style-type: upper-alpha;"
382373 ><li
383374 >a subsublist</li
384375 ><li
@@ -390,13 +381,13 @@ These should not be escaped: \$ \\ \&gt; \[ \{
390381 ></ol
391382 ><p
392383 >Nesting:</p
393− ><ol class="upper-alpha"
384+ ><ol style="list-style-type: upper-alpha;"
394385 ><li
395− >Upper Alpha<ol class="upper-roman"
386+ >Upper Alpha<ol style="list-style-type: upper-roman;"
396387 ><li
397− >Upper Roman.<ol start="6" class="decimal"
388+ >Upper Roman.<ol start="6" style="list-style-type: decimal;"
398389 ><li
399− >Decimal start with 6<ol start="3" class="lower-alpha"
390+ >Decimal start with 6<ol start="3" style="list-style-type: lower-alpha;"
400391 ><li
401392 >Lower alpha with paren</li
402393 ></ol
@@ -674,7 +665,7 @@ Blah
674665 >&lt;html&gt;</code
675666 >.</p
676667 ><p
677− ><span class="strikeout"
668+ ><span style="text-decoration: line-through;"
678669 >This is <em
679670 >strikeout</em
680671 >.</span
@@ -1075,7 +1066,7 @@ document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+
10751066 ></a
10761067 ></p
10771068 ></blockquote
1078− ><ol class="decimal"
1069+ ><ol style="list-style-type: decimal;"
10791070 ><li
10801071 >And in list items.<a href="#fn5" class="footnoteRef" id="fnref5"
10811072 ><sup