Fix escapes of highlighted code

pull/1/head
trivernis 5 years ago
parent 3b75ad10dc
commit 9e1d13bce5

2
Cargo.lock generated

@ -444,7 +444,7 @@ dependencies = [
[[package]] [[package]]
name = "snekdown" name = "snekdown"
version = "0.2.1" version = "0.2.2"
dependencies = [ dependencies = [
"crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",

@ -1,6 +1,6 @@
[package] [package]
name = "snekdown" name = "snekdown"
version = "0.2.1" version = "0.2.2"
authors = ["trivernis <trivernis@protonmail.com>"] authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018" edition = "2018"
license-file = "LICENSE" license-file = "LICENSE"

@ -25,7 +25,7 @@ ARGS:
### Images ### Images
``` ```md
Simple Syntax Simple Syntax
!(url) !(url)
@ -39,9 +39,10 @@ Extended syntax with metadata and no description
!(url)[metadata] !(url)[metadata]
``` ```
### Quotes ### Quotes
``` ```md
Simple (default) Syntax Simple (default) Syntax
> This is a quote > This is a quote
@ -53,16 +54,22 @@ Quote with metadata (e.g. Author)
[Trivernis - 2020]> This is a quote with metadata [Trivernis - 2020]> This is a quote with metadata
``` ```
### Imports ### Imports
Imports can be used to import a different document to be attached to the main document. Imports can be used to import a different document to be attached to the main document.
Imports are parsed via multithreading. Imports are parsed via multithreading.
```md
<[path]
```
### Tables ### Tables
Tables MUST start with a pipe character `|` Tables MUST start with a pipe character `|`
``` ```md
Standalone header: Standalone header:
| header | header | header | header | header | header
@ -71,7 +78,3 @@ Header with rows
|--------|--------|------- |--------|--------|-------
| row | row | row | row | row | row
``` ```
```
<[path]
```

@ -199,7 +199,7 @@ impl ToHtml for CodeBlock {
"<div><code lang='{}'>{}</code></div>", "<div><code lang='{}'>{}</code></div>",
encode_attribute(self.language.clone().as_str()), encode_attribute(self.language.clone().as_str()),
highlighted_html_for_string( highlighted_html_for_string(
encode_minimal(self.code.as_str()).as_str(), self.code.as_str(),
&ps, &ps,
syntax, syntax,
&ts.themes["InspiredGitHub"] &ts.themes["InspiredGitHub"]

Loading…
Cancel
Save