diff --git a/Cargo.lock b/Cargo.lock index 36d0b5b..73c3b6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -324,9 +324,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.166" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "litemap" @@ -453,7 +453,7 @@ dependencies = [ "mrml", "nom", "pulldown-cmark", - "pulldown-cmark-escape 0.10.1", + "pulldown-cmark-escape", "serde", "serde-wasm-bindgen", "textwrap", @@ -558,16 +558,10 @@ dependencies = [ "bitflags", "getopts", "memchr", - "pulldown-cmark-escape 0.11.0", + "pulldown-cmark-escape", "unicase", ] -[[package]] -name = "pulldown-cmark-escape" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd348ff538bc9caeda7ee8cad2d1d48236a1f443c1fa3913c6a02fe0043b1dd3" - [[package]] name = "pulldown-cmark-escape" version = "0.11.0" @@ -735,9 +729,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.89" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 0de154f..7764578 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ js-sys = "0.3.69" mrml = { version = "4.0.1", features = ["parse", "render"], default-features = false } nom = { version = "7.1.3", features = ["alloc"] } pulldown-cmark = "0.12.2" -pulldown-cmark-escape = "0.10.1" +pulldown-cmark-escape = "0.11.0" serde = { version = "1.0.215", features = ["derive"] } serde-wasm-bindgen = "0.6.5" textwrap = "0.16.1" diff --git a/lib/parsedown.generated.js b/lib/parsedown.generated.js index c5279c6..7300fb4 100644 --- a/lib/parsedown.generated.js +++ b/lib/parsedown.generated.js @@ -4,7 +4,7 @@ // deno-fmt-ignore-file /// -// source-hash: bc0127bb39f9a938a25cd8cb0b00b1dd6f14e9b2 +// source-hash: 5e420860f9476779457dcdd2d889abf9802f2938 let wasm; const heap = new Array(128).fill(undefined); @@ -50,6 +50,18 @@ function addHeapObject(obj) { return idx; } +function dropObject(idx) { + if (idx < 132) return; + heap[idx] = heap_next; + heap_next = idx; +} + +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} + let WASM_VECTOR_LEN = 0; const cachedTextEncoder = typeof TextEncoder !== "undefined" @@ -115,18 +127,6 @@ function getInt32Memory0() { return cachedInt32Memory0; } -function dropObject(idx) { - if (idx < 132) return; - heap[idx] = heap_next; - heap_next = idx; -} - -function takeObject(idx) { - const ret = getObject(idx); - dropObject(idx); - return ret; -} - let cachedFloat64Memory0 = null; function getFloat64Memory0() { @@ -319,6 +319,9 @@ const imports = { const ret = getStringFromWasm0(arg0, arg1); return addHeapObject(ret); }, + __wbindgen_object_drop_ref: function (arg0) { + takeObject(arg0); + }, __wbindgen_number_new: function (arg0) { const ret = arg0; return addHeapObject(ret); @@ -359,9 +362,6 @@ const imports = { __wbg_set_a47bac70306a19a7: function (arg0, arg1, arg2) { getObject(arg0).set(getObject(arg1), arg2 >>> 0); }, - __wbindgen_object_drop_ref: function (arg0) { - takeObject(arg0); - }, __wbindgen_error_new: function (arg0, arg1) { const ret = new Error(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); diff --git a/lib/parsedown_bg.wasm b/lib/parsedown_bg.wasm index 77ccdba..9127a78 100644 Binary files a/lib/parsedown_bg.wasm and b/lib/parsedown_bg.wasm differ diff --git a/src/markdown/mod.rs b/src/markdown/mod.rs index 1cff633..d9ccc82 100644 --- a/src/markdown/mod.rs +++ b/src/markdown/mod.rs @@ -194,7 +194,7 @@ struct PlaintextWriter<'a, I, W> { impl<'a, I, W> PlaintextWriter<'a, I, W> where I: Iterator>, - W: StrWrite, + W: StrWrite, { fn new(iter: I, writer: W, canonical_root_url: Option<&'a str>) -> Self { Self { @@ -210,14 +210,14 @@ where } /// Writes a new line. - fn write_newline(&mut self) -> io::Result<()> { + fn write_newline(&mut self) -> Result<(), std::fmt::Error> { self.end_newline = true; self.writer.write_str("\n") } /// Wraps the current line on input to preferred length and writes the wrapped lines #[inline] - fn write(&mut self) -> io::Result<()> { + fn write(&mut self) -> Result<(), std::fmt::Error> { let lines = wrap(&self.current_line, self.line_length); for line in &lines { self.writer.write_str(line)?; @@ -231,7 +231,7 @@ where Ok(()) } - fn run(mut self) -> io::Result<()> { + fn run(mut self) -> Result<(), std::fmt::Error> { while let Some(event) = self.iter.next() { match event { Start(tag) => { @@ -283,7 +283,7 @@ where } /// Handles the start of an HTML tag. - fn start_tag(&mut self, tag: Tag) -> io::Result<()> { + fn start_tag(&mut self, tag: Tag) -> Result<(), std::fmt::Error> { match tag { Tag::Paragraph => { if self.end_newline { @@ -317,7 +317,7 @@ where } } - fn end_tag(&mut self, tag: TagEnd) -> io::Result<()> { + fn end_tag(&mut self, tag: TagEnd) -> Result<(), std::fmt::Error> { match tag { TagEnd::Paragraph => { self.write()?;