Fix incorrectly ordered classes

This commit is contained in:
Michael Howell 2021-09-18 16:54:12 -07:00
parent 6075bd1930
commit 924b4bfc2e
2 changed files with 6 additions and 6 deletions

View File

@ -338,7 +338,7 @@ impl<'a> SyntaxHighlighter<'a> {
} }
self.is_playground = true; self.is_playground = true;
return Event::Html(CowStr::from(format!( return Event::Html(CowStr::from(format!(
r#"<pre class="playground syntect"><code class="language-{}">"#, r#"<pre class="syntect playground"><code class="language-{}">"#,
classes.join(" ") classes.join(" ")
))); )));
} else { } else {
@ -613,7 +613,7 @@ more text with spaces
``` ```
"#; "#;
let expected = r#"<pre class="playground"><code class="language-rust no_run should_panic property_3"></code></pre>"#; let expected = r#"<pre class="syntect playground"><code class="language-rust no_run should_panic property_3"></code></pre>"#;
assert_eq!( assert_eq!(
render_markdown( render_markdown(
input, input,
@ -643,7 +643,7 @@ more text with spaces
``` ```
"#; "#;
let expected = r#"<pre class="playground"><code class="language-rust no_run should_panic property_3"></code></pre>"#; let expected = r#"<pre class="syntect playground"><code class="language-rust no_run should_panic property_3"></code></pre>"#;
assert_eq!( assert_eq!(
render_markdown( render_markdown(
input, input,
@ -673,7 +673,7 @@ more text with spaces
``` ```
"#; "#;
let expected = r#"<pre class="playground"><code class="language-rust"></code></pre>"#; let expected = r#"<pre class="syntect playground"><code class="language-rust"></code></pre>"#;
assert_eq!( assert_eq!(
render_markdown( render_markdown(
input, input,

View File

@ -144,7 +144,7 @@ fn rendered_code_has_playground_stuff() {
md.build().unwrap(); md.build().unwrap();
let nested = temp.path().join("book/first/nested.html"); let nested = temp.path().join("book/first/nested.html");
let playground_class = vec![r#"class="playground""#]; let playground_class = vec![r#"class="syntect playground""#];
assert_contains_strings(nested, &playground_class); assert_contains_strings(nested, &playground_class);
@ -392,7 +392,7 @@ fn able_to_include_playground_files_in_chapters() {
let second = temp.path().join("book/second.html"); let second = temp.path().join("book/second.html");
let playground_strings = &[ let playground_strings = &[
r#"class="playground""#, r#"class="syntect playground""#,
r#"<span class="syn-support syn-macro syn-rust">println!</span><span class="syn-meta syn-group syn-rust"><span class="syn-punctuation syn-section syn-group syn-begin syn-rust">(</span></span><span class="syn-meta syn-group syn-rust"><span class="syn-string syn-quoted syn-double syn-rust"><span class="syn-punctuation syn-definition syn-string syn-begin syn-rust">&quot;</span>Hello World!"#, r#"<span class="syn-support syn-macro syn-rust">println!</span><span class="syn-meta syn-group syn-rust"><span class="syn-punctuation syn-section syn-group syn-begin syn-rust">(</span></span><span class="syn-meta syn-group syn-rust"><span class="syn-string syn-quoted syn-double syn-rust"><span class="syn-punctuation syn-definition syn-string syn-begin syn-rust">&quot;</span>Hello World!"#,
]; ];