From 8f9cea7f58e8acbffd2a14bc41225f4609963584 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Wed, 29 Oct 2014 01:08:31 -0400 Subject: [PATCH] Enable descriptive header IDs. Enable blackfriday.EXTENSION_AUTO_HEADER_IDS to generate the name of the header ID from the text in the header. Works for prefix and underline headers. - TOC extraction had to be modified to look for `
  • For some moments the old man did not reply. He stood with bowed head, buried in deep thought. But at last he spoke.

    \n\n

    AA

    \n\n

    I have no idea, of course, how long it took me to reach the limit of the plain,\nbut at last I entered the foothills, following a pretty little canyon upward\ntoward the mountains. Beside me frolicked a laughing brooklet, hurrying upon\nits noisy way down to the silent sea. In its quieter pools I discovered many\nsmall fish, of four-or five-pound weight I should imagine. In appearance,\nexcept as to size and color, they were not unlike the whale of our own seas. As\nI watched them playing about I discovered, not only that they suckled their\nyoung, but that at intervals they rose to the surface to breathe as well as to\nfeed upon certain grasses and a strange, scarlet lichen which grew upon the\nrocks just above the water line.

    \n\n

    AAA

    \n\n

    I remember I felt an extraordinary persuasion that I was being played with,\nthat presently, when I was upon the very verge of safety, this mysterious\ndeath–as swift as the passage of light–would leap after me from the pit about\nthe cylinder and strike me down. ## BB

    \n\n

    BBB

    \n\n

    “You’re a great Granser,” he cried delightedly, “always making believe them little marks mean something.”

    \n") - checkPageTOC(t, p, "
    ") + checkPageContent(t, p, "\n\n

    For some moments the old man did not reply. He stood with bowed head, buried in deep thought. But at last he spoke.

    \n\n

    AA

    \n\n

    I have no idea, of course, how long it took me to reach the limit of the plain,\nbut at last I entered the foothills, following a pretty little canyon upward\ntoward the mountains. Beside me frolicked a laughing brooklet, hurrying upon\nits noisy way down to the silent sea. In its quieter pools I discovered many\nsmall fish, of four-or five-pound weight I should imagine. In appearance,\nexcept as to size and color, they were not unlike the whale of our own seas. As\nI watched them playing about I discovered, not only that they suckled their\nyoung, but that at intervals they rose to the surface to breathe as well as to\nfeed upon certain grasses and a strange, scarlet lichen which grew upon the\nrocks just above the water line.

    \n\n

    AAA

    \n\n

    I remember I felt an extraordinary persuasion that I was being played with,\nthat presently, when I was upon the very verge of safety, this mysterious\ndeath–as swift as the passage of light–would leap after me from the pit about\nthe cylinder and strike me down. ## BB

    \n\n

    BBB

    \n\n

    “You’re a great Granser,” he cried delightedly, “always making believe them little marks mean something.”

    \n") + checkPageTOC(t, p, "") } func TestPageWithMoreTag(t *testing.T) { diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index 002946bf..9c5bc1c5 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -74,7 +74,7 @@ func TestInnerSCWithMarkdown(t *testing.T) { [link](http://spf13.com) and text -{{% /inside %}}`, "

    More Here

    \n\n

    link and text

    \n
    ", tem) +{{% /inside %}}`, "

    More Here

    \n\n

    link and text

    \n
    ", tem) } func TestInnerSCWithAndWithoutMarkdown(t *testing.T) { @@ -96,7 +96,7 @@ And then: This is **plain** text. {{< /inside >}} -`, "

    More Here

    \n\n

    link and text

    \n
    \n\nAnd then:\n\n
    \n# More Here\n\nThis is **plain** text.\n\n
    \n", tem) +`, "

    More Here

    \n\n

    link and text

    \n
    \n\nAnd then:\n\n
    \n# More Here\n\nThis is **plain** text.\n\n
    \n", tem) } func TestEmbeddedSC(t *testing.T) { diff --git a/hugolib/site_test.go b/hugolib/site_test.go index ce1d3f0a..94f73734 100644 --- a/hugolib/site_test.go +++ b/hugolib/site_test.go @@ -112,7 +112,7 @@ func TestRenderThing(t *testing.T) { }{ {PAGE_SIMPLE_TITLE, TEMPLATE_TITLE, "simple template"}, {PAGE_SIMPLE_TITLE, TEMPLATE_FUNC, "simple-template"}, - {PAGE_WITH_MD, TEMPLATE_CONTENT, "\n\n

    heading 1

    \n\n

    text

    \n\n

    heading 2

    \n\n

    more text

    \n"}, + {PAGE_WITH_MD, TEMPLATE_CONTENT, "\n\n

    heading 1

    \n\n

    text

    \n\n

    heading 2

    \n\n

    more text

    \n"}, {SIMPLE_PAGE_RFC3339_DATE, TEMPLATE_DATE, "2013-05-17 16:59:30 +0000 UTC"}, } @@ -337,14 +337,14 @@ func TestSkipRender(t *testing.T) { doc string expected string }{ - {"sect/doc1.html", "\n\n

    title

    \n\n

    some content

    \n"}, + {"sect/doc1.html", "\n\n

    title

    \n\n

    some content

    \n"}, {"sect/doc2.html", "more content"}, - {"sect/doc3.html", "\n\n

    doc3

    \n\n

    some content

    \n"}, - {"sect/doc4.html", "\n\n

    doc4

    \n\n

    some content

    \n"}, + {"sect/doc3.html", "\n\n

    doc3

    \n\n

    some content

    \n"}, + {"sect/doc4.html", "\n\n

    doc4

    \n\n

    some content

    \n"}, {"sect/doc5.html", "body5"}, {"sect/doc6.html", "body5"}, {"doc7.html", "doc7 content"}, - {"sect/doc8.html", "\n\n

    title

    \n\n

    some content

    \n"}, + {"sect/doc8.html", "\n\n

    title

    \n\n

    some content

    \n"}, } for _, test := range tests { -- 2.30.2