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
This commit is contained in:
parent
ac3ced828b
commit
cc67bf0c88
|
@ -17,8 +17,7 @@ use utils::vec::InsertMany;
|
|||
|
||||
use self::cmark::{Event, LinkType, Options, Parser, Tag};
|
||||
|
||||
const CONTINUE_READING: &str =
|
||||
"<p id=\"zola-continue-reading\"><a name=\"continue-reading\"></a></p>\n";
|
||||
const CONTINUE_READING: &str = "<span id=\"continue-reading\"></span>";
|
||||
const ANCHOR_LINK_TEMPLATE: &str = "anchor-link.html";
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
@ -757,7 +757,7 @@ Bla bla
|
|||
.unwrap();
|
||||
assert_eq!(
|
||||
res.body,
|
||||
"<p>Hello <a href=\"https://vincentprouillet.com\">My site</a></p>\n<p id=\"zola-continue-reading\"><a name=\"continue-reading\"></a></p>\n<p>Bla bla</p>\n"
|
||||
"<p>Hello <a href=\"https://vincentprouillet.com\">My site</a></p>\n<span id=\"continue-reading\"></span>\n<p>Bla bla</p>\n"
|
||||
);
|
||||
assert_eq!(
|
||||
res.summary_len,
|
||||
|
|
|
@ -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#"<a name="continue-reading"></a>"#
|
||||
r#"<span id="continue-reading"></span>"#
|
||||
));
|
||||
|
||||
// Drafts are included
|
||||
|
|
|
@ -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:
|
||||
`<a href="{{ page.permalink }}#continue-reading">Continue Reading</a>`.
|
||||
|
|
Loading…
Reference in a new issue