diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-09-10 08:54:03 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-09-10 11:03:47 +0200 |
commit | 3d6baedaec306300f2c6f7ed471e774dca0f112a (patch) | |
tree | 4a7b7f62c337aceb9983f8a0490b7e153a7b3d23 /hugolib | |
parent | 84ee00bbc24328295237695a39e6e876ed186312 (diff) | |
download | hugo-3d6baedaec306300f2c6f7ed471e774dca0f112a.tar.gz hugo-3d6baedaec306300f2c6f7ed471e774dca0f112a.zip |
Don't count HTML markup in auto summaries
This commit also fixes a bug where a `</picture>` end tag was wrongly used to detect a end paragraph. This should be very rare, though.
Closes #12837
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/page_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hugolib/page_test.go b/hugolib/page_test.go index 66afd7d96..429ab2659 100644 --- a/hugolib/page_test.go +++ b/hugolib/page_test.go @@ -593,7 +593,7 @@ func TestPageSummary(t *testing.T) { // Source is not Asciidoctor- or RST-compatible so don't test them if ext != "ad" && ext != "rst" { checkPageContent(t, p, normalizeExpected(ext, "<p><a href=\"https://lipsum.com/\">Lorem ipsum</a> dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\n<p>Additional text.</p>\n\n<p>Further text.</p>\n"), ext) - checkPageSummary(t, p, normalizeExpected(ext, "<p><a href=\"https://lipsum.com/\">Lorem ipsum</a> dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"), ext) + checkPageSummary(t, p, normalizeExpected(ext, "<p><a href=\"https://lipsum.com/\">Lorem ipsum</a> dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p><p>Additional text.</p>"), ext) } checkPageType(t, p, "page") } |