From eea359203ac7f861ac9536b39e639f6c65579501 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Fri, 29 Dec 2006 08:04:39 +0000 Subject: [PATCH] Reversed changes from r246: + Removed invisible anchors in front of header tags in HTML output. Reason: no way to prevent duplicate ID attributes (which is invalid HTML), since there might be duplicate header titles. See http://six.pairlist.net/pipermail/markdown-discuss/2005-January/000975.html. git-svn-id: https://pandoc.googlecode.com/svn/trunk@306 788f1e2b-df1e-0410-8736-df70ead52e1b --- README | 21 --------------------- src/Text/Pandoc/Writers/HTML.hs | 4 +--- tests/s5.basic.html | 8 -------- tests/s5.fancy.html | 8 -------- tests/s5.fragment.html | 3 --- tests/s5.inserts.html | 3 --- tests/writer.html | 29 ----------------------------- tests/writer.smart.html | 29 ----------------------------- 8 files changed, 1 insertion(+), 104 deletions(-) diff --git a/README b/README index d3a3e7326..6c3210d9a 100644 --- a/README +++ b/README @@ -298,27 +298,6 @@ markdown test suite, type `make test-markdown`.) [standard markdown]: http://daringfireball.net/projects/markdown/syntax "Markdown syntax description" -Section Headings ----------------- - -Pandoc creates an invisible anchor in front of every HTML section -heading. The ID of this anchor is derived from the section heading -itself: spaces are converted to underscores, and formatting, links, -and other markup are removed. Thus, for example, the source - - ## Aristotle's *De Anima* - -gets converted to HTML as follows: - - -

Aristotle's De Anima

- -This makes it easy to provide internal links that jump to a particular -place in a document. To provide a link to the heading above, for -example, just insert: - - [Back to Aristotle](#Aristotle's_De_Anima) - Lists ----- diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 7d4e8891f..effede04c 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -228,10 +228,8 @@ blockToHtml options (OrderedList lst) = blockToHtml options HorizontalRule = "
\n" blockToHtml options (Header level lst) = let contents = inlineListToHtml options lst in - let simplify = gsub "<[^>]*>" "" . gsub " " "_" in if ((level > 0) && (level <= 6)) - then "\n" ++ - "" ++ contents ++ + then "" ++ contents ++ "\n" else "

" ++ contents ++ "

\n" listItemToHtml options list = diff --git a/tests/s5.basic.html b/tests/s5.basic.html index 29934e6c1..ac06eabd0 100644 --- a/tests/s5.basic.html +++ b/tests/s5.basic.html @@ -747,24 +747,18 @@ window.onresize = function(){setTimeout('fontScale()', 50);}
-

My S5 Document

-

Sam Smith, Jen Jones

-

July 15, 2006

-

First slide

  • first bullet
  • @@ -772,7 +766,6 @@ window.onresize = function(){setTimeout('fontScale()', 50);}
-

Smarty

  • "Hello there"
  • @@ -781,7 +774,6 @@ window.onresize = function(){setTimeout('fontScale()', 50);}
-

Math

  • $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
  • diff --git a/tests/s5.fancy.html b/tests/s5.fancy.html index dadb9f7f7..fbf872241 100644 --- a/tests/s5.fancy.html +++ b/tests/s5.fancy.html @@ -1659,24 +1659,18 @@ else
-

My S5 Document

-

Sam Smith, Jen Jones

-

July 15, 2006

-

First slide

  • first bullet
  • @@ -1684,7 +1678,6 @@ else
-

Smarty

  • “Hello there”
  • @@ -1693,7 +1686,6 @@ else
-

Math

  • $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
  • diff --git a/tests/s5.fragment.html b/tests/s5.fragment.html index 240bafb35..370b9c111 100644 --- a/tests/s5.fragment.html +++ b/tests/s5.fragment.html @@ -1,10 +1,8 @@ -

    First slide

    • first bullet
    • second bullet
    -

    Smarty

      @@ -13,7 +11,6 @@
    • And 'ellipses'...
    -

    Math

    • $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
    • diff --git a/tests/s5.inserts.html b/tests/s5.inserts.html index ba6ae5f48..7be33a2c8 100644 --- a/tests/s5.inserts.html +++ b/tests/s5.inserts.html @@ -13,13 +13,11 @@ STUFF INSERTED STUFF INSERTED

      My S5 Document

      -

      First slide

      • first bullet
      • second bullet
      -

      Smarty

        @@ -28,7 +26,6 @@ STUFF INSERTED
      • And 'ellipses'...
      -

      Math

      • $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
      • diff --git a/tests/writer.html b/tests/writer.html index c421d24c4..e4f5c5d0c 100644 --- a/tests/writer.html +++ b/tests/writer.html @@ -12,28 +12,18 @@

        Pandoc Test Suite

        This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.


        -

        Headers

        -

        Level 2 with an embedded link

        -

        Level 3 with emphasis

        -

        Level 4

        -
        Level 5
        -

        Level 1

        -

        Level 2 with emphasis

        -

        Level 3

        with no blank line

        -

        Level 2

        with no blank line


        -

        Paragraphs

        Here's a regular paragraph.

        In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.

        @@ -41,7 +31,6 @@

        There should be a hard line break
        here.


        -

        Block Quotes

        E-mail style:

        @@ -90,7 +79,6 @@ here.

        And a following paragraph.


        -

        Code Blocks

        Code:

        ---- (should be four hyphens)
        @@ -107,9 +95,7 @@ this code block is indented by one tab
         These should not be escaped:  \$ \\ \> \[ \{
         

        -

        Lists

        -

        Unordered

        Asterisks tight:

          @@ -156,7 +142,6 @@ These should not be escaped: \$ \\ \> \[ \{
        • Minus 3

        -

        Ordered

        Tight:

          @@ -198,7 +183,6 @@ These should not be escaped: \$ \\ \> \[ \{
        1. Item 3.

        -

        Nested

        • Tab
            @@ -234,7 +218,6 @@ These should not be escaped: \$ \\ \> \[ \{
          • Third

          • -

            Tabs and spaces

            • this is a list item indented with tabs

              @@ -249,7 +232,6 @@ These should not be escaped: \$ \\ \> \[ \{

            -

            HTML Blocks

            Simple block on one line:

            foo
            @@ -325,7 +307,6 @@ Blah

            -

            Inline Markup

            This is emphasized, and so is this.

            This is strong, and so is this.

            @@ -336,7 +317,6 @@ Blah

            So is this word.

            This is code: >, $, \, \$, <html>.


            -

            Smart quotes, ellipses, dashes

            "Hello," said the spider. "'Shelob' is my name."

            'A', 'B', and 'C' are letters.

            @@ -347,7 +327,6 @@ Blah

            Dashes between numbers: 5-7, 255-66, 1987-1999.

            Ellipses...and. . .and . . . .


            -

            LaTeX

            • \cite[22-23]{smith.1899}
            • @@ -373,7 +352,6 @@ Dog & 2 \\ Cat & 1 \\ \hline \end{tabular}


              -

              Special Characters

              Here is some unicode:

                @@ -405,9 +383,7 @@ Cat & 1 \\ \hline

                Plus: +

                Minus: -


                -

                Links

                -

                Explicit

                Just a URL.

                URL and title.

                @@ -422,7 +398,6 @@ document.write(''+'Email link'+'<\/'+'a'+'>') // -->

                Empty.

                -

                Reference

                Foo bar.

                Foo bar.

                @@ -437,13 +412,11 @@ document.write(''+'Email link'+'<\/'+'a'+'>')

                Foo bar.

                Foo biz.

                -

                With ampersands

                Here's a link with an ampersand in the URL.

                Here's a link with an amersand in the link text: AT&T.

                Here's an inline link.

                Here's an inline link in pointy braces.

                -

                Autolinks

                With an ampersand: http://example.com/?foo=1&bar=2

                  @@ -464,13 +437,11 @@ document.write(''+e+'<\/'+'a'+'>');
                  or here: <http://example.com/>
                   

                  -

                  Images

                  From "Voyage dans la Lune" by Georges Melies (1902):

                  lalune

                  Here is a movie movie icon.


                  -

                  Footnotes

                  Here is a footnote reference,1 and another.2 This should not be a footnote reference, because it contains a space.[^my note] Here is an inline note.3

                  diff --git a/tests/writer.smart.html b/tests/writer.smart.html index d78ac4561..1c2574966 100644 --- a/tests/writer.smart.html +++ b/tests/writer.smart.html @@ -12,28 +12,18 @@

                  Pandoc Test Suite

                  This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.


                  -

                  Headers

                  -

                  Level 2 with an embedded link

                  -

                  Level 3 with emphasis

                  -

                  Level 4

                  -
                  Level 5
                  -

                  Level 1

                  -

                  Level 2 with emphasis

                  -

                  Level 3

                  with no blank line

                  -

                  Level 2

                  with no blank line


                  -

                  Paragraphs

                  Here’s a regular paragraph.

                  In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.

                  @@ -41,7 +31,6 @@

                  There should be a hard line break
                  here.


                  -

                  Block Quotes

                  E-mail style:

                  @@ -90,7 +79,6 @@ here.

                  And a following paragraph.


                  -

                  Code Blocks

                  Code:

                  ---- (should be four hyphens)
                  @@ -107,9 +95,7 @@ this code block is indented by one tab
                   These should not be escaped:  \$ \\ \> \[ \{
                   

                  -

                  Lists

                  -

                  Unordered

                  Asterisks tight:

                    @@ -156,7 +142,6 @@ These should not be escaped: \$ \\ \> \[ \{
                  • Minus 3

                  -

                  Ordered

                  Tight:

                    @@ -198,7 +183,6 @@ These should not be escaped: \$ \\ \> \[ \{
                  1. Item 3.

                  -

                  Nested

                  • Tab
                      @@ -234,7 +218,6 @@ These should not be escaped: \$ \\ \> \[ \{
                    • Third

                    • -

                      Tabs and spaces

                      • this is a list item indented with tabs

                        @@ -249,7 +232,6 @@ These should not be escaped: \$ \\ \> \[ \{

                      -

                      HTML Blocks

                      Simple block on one line:

                      foo
                      @@ -325,7 +307,6 @@ Blah

                      -

                      Inline Markup

                      This is emphasized, and so is this.

                      This is strong, and so is this.

                      @@ -336,7 +317,6 @@ Blah

                      So is this word.

                      This is code: >, $, \, \$, <html>.


                      -

                      Smart quotes, ellipses, dashes

                      “Hello,” said the spider. “‘Shelob’ is my name.”

                      ‘A’, ‘B’, and ‘C’ are letters.

                      @@ -347,7 +327,6 @@ Blah

                      Dashes between numbers: 5–7, 255–66, 1987–1999.

                      Ellipses…and…and … .


                      -

                      LaTeX