From 839f77d81ecd742d6368f8b140eeccd37d8a80e7 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sun, 24 Feb 2008 18:15:36 +0000 Subject: [PATCH] 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 --- Text/Pandoc/Writers/HTML.hs | 13 +++-------- tests/writer.html | 45 +++++++++++++++---------------------- 2 files changed, 21 insertions(+), 37 deletions(-) diff --git a/Text/Pandoc/Writers/HTML.hs b/Text/Pandoc/Writers/HTML.hs index d4ba09293..6ada56ba2 100644 --- a/Text/Pandoc/Writers/HTML.hs +++ b/Text/Pandoc/Writers/HTML.hs @@ -331,13 +331,8 @@ blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do then [start startnum] else []) ++ (if numstyle /= DefaultStyle - then [theclass numstyle'] + then [thestyle $ "list-style-type: " ++ numstyle' ++ ";"] else []) - if numstyle /= DefaultStyle - then addToCSS $ "ol." ++ numstyle' ++ - " { list-style-type: " ++ - numstyle' ++ "; }" - else return () return $ ordList ! attribs $ contents blockToHtml opts (DefinitionList lst) = do contents <- mapM (\(term, def) -> do term' <- inlineListToHtml opts term @@ -405,10 +400,8 @@ inlineToHtml opts inline = (Emph lst) -> inlineListToHtml opts lst >>= return . emphasize (Strong lst) -> inlineListToHtml opts lst >>= return . strong (Code str) -> return $ thecode << str - (Strikeout lst) -> addToCSS - ".strikeout { text-decoration: line-through; }" >> - inlineListToHtml opts lst >>= - return . (thespan ! [theclass "strikeout"]) + (Strikeout lst) -> inlineListToHtml opts lst >>= + return . (thespan ! [thestyle "text-decoration: line-through;"]) (Superscript lst) -> inlineListToHtml opts lst >>= return . sup (Subscript lst) -> inlineListToHtml opts lst >>= return . sub (Quoted quoteType lst) -> diff --git a/tests/writer.html b/tests/writer.html index 890ce258c..99819f990 100644 --- a/tests/writer.html +++ b/tests/writer.html @@ -8,16 +8,7 @@ />

Pandoc Test Suite

A list:

    1. item one
    2. Ordered

      Tight:

        1. First

        and:

          1. One

          Loose using tabs:

            1. First

            and using spaces:

              1. One

              Multiple paragraphs:

                1. Item 1, graf one.

                  Here’s another:

                    1. First

                    Same thing but with paragraphs:

                      1. First

                        Fancy list markers

                          1. begins with 2
                          2. and now 3

                            with a continuation

                              1. sublist with roman numerals, starting with 4
                              2. more items
                                  more items
                                  1. a subsublist

                                  Nesting:

                                    1. Upper Alpha
                                        Upper Alpha
                                        1. Upper Roman.
                                            Upper Roman.
                                            1. Decimal start with 6
                                                Decimal start with 6
                                                1. Lower alpha with paren
                                                <html>.

                                                This is strikeout.'+''+e+''+'<\/'+ >

                                                  1. And in list items.