|
@@ -28,12 +28,12 @@ pub struct InsertableSnippet {
|
28
|
28
|
|
29
|
29
|
fn format_snippet(filetype: Option<String>, body: String) -> String {
|
30
|
30
|
filetype.map_or(
|
31
|
|
- format!("<pre class='plaintext'>{}</pre>", body),
|
|
31
|
+ format!("<pre class='plaintext'>\n{}\n</pre>", body),
|
32
|
32
|
|filetype| {
|
33
|
33
|
let ps = SyntaxSet::load_defaults_newlines();
|
34
|
34
|
let ts = ThemeSet::load_defaults();
|
35
|
35
|
ps.find_syntax_by_extension(&filetype).map_or(
|
36
|
|
- format!("<pre class='plaintext'>{}</pre>", body),
|
|
36
|
+ format!("<pre class='plaintext'>\n{}\n</pre>", body),
|
37
|
37
|
|syntax| {
|
38
|
38
|
highlighted_html_for_string(
|
39
|
39
|
&htmlescape::decode_html(&body).expect("Invalid HTML"),
|