From cc67bf0c88a654dd8edb489525e6f07a9bd5f8da Mon Sep 17 00:00:00 2001 From: Aphek Date: Fri, 7 Feb 2020 17:07:10 -0300 Subject: [PATCH] Change continue-reading to use a span with id instead of a named anchor in a paragraph (#941) * Change continue-reading to use a span element instead of named anchor * Fix all tests --- components/rendering/src/markdown.rs | 3 +-- components/rendering/tests/markdown.rs | 2 +- components/site/tests/site.rs | 4 ++-- docs/content/documentation/content/page.md | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/components/rendering/src/markdown.rs b/components/rendering/src/markdown.rs index 067427d..3522f18 100644 --- a/components/rendering/src/markdown.rs +++ b/components/rendering/src/markdown.rs @@ -17,8 +17,7 @@ use utils::vec::InsertMany; use self::cmark::{Event, LinkType, Options, Parser, Tag}; -const CONTINUE_READING: &str = - "

\n"; +const CONTINUE_READING: &str = ""; const ANCHOR_LINK_TEMPLATE: &str = "anchor-link.html"; #[derive(Debug)] diff --git a/components/rendering/tests/markdown.rs b/components/rendering/tests/markdown.rs index cf1b03b..34475bc 100644 --- a/components/rendering/tests/markdown.rs +++ b/components/rendering/tests/markdown.rs @@ -757,7 +757,7 @@ Bla bla .unwrap(); assert_eq!( res.body, - "

Hello My site

\n

\n

Bla bla

\n" + "

Hello My site

\n\n

Bla bla

\n" ); assert_eq!( res.summary_len, diff --git a/components/site/tests/site.rs b/components/site/tests/site.rs index 94dddd7..2c02a68 100644 --- a/components/site/tests/site.rs +++ b/components/site/tests/site.rs @@ -239,11 +239,11 @@ fn can_build_site_with_live_reload_and_drafts() { // no live reload code assert!(file_contains!(public, "index.html", "/livereload.js")); - // the summary anchor link has been created + // the summary target has been created assert!(file_contains!( public, "posts/python/index.html", - r#""# + r#""# )); // Drafts are included diff --git a/docs/content/documentation/content/page.md b/docs/content/documentation/content/page.md index de73184..b43790f 100644 --- a/docs/content/documentation/content/page.md +++ b/docs/content/documentation/content/page.md @@ -141,6 +141,5 @@ where you want the summary to end. The content up to that point will be available separately in the [template](@/documentation/templates/pages-sections.md#page-variables). -An anchor link to this position named `continue-reading` is created, wrapped in a paragraph -with a `zola-continue-reading` id, so you can link directly to it if needed. For example: +A span element in this position with a `continue-reading` id is created, so you can link directly to it if needed. For example: `Continue Reading`.