Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/checkout-4…
Browse files Browse the repository at this point in the history
….2.2
  • Loading branch information
rodneylab authored Nov 30, 2024
2 parents 4280d5a + 9f150d9 commit 5a2a113
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 35 deletions.
18 changes: 6 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
32 changes: 16 additions & 16 deletions lib/parsedown.generated.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// deno-fmt-ignore-file
/// <reference types="./parsedown.generated.d.ts" />

// source-hash: bc0127bb39f9a938a25cd8cb0b00b1dd6f14e9b2
// source-hash: 5e420860f9476779457dcdd2d889abf9802f2938
let wasm;

const heap = new Array(128).fill(undefined);
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
Binary file modified lib/parsedown_bg.wasm
Binary file not shown.
12 changes: 6 additions & 6 deletions src/markdown/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ struct PlaintextWriter<'a, I, W> {
impl<'a, I, W> PlaintextWriter<'a, I, W>
where
I: Iterator<Item = Event<'a>>,
W: StrWrite,
W: StrWrite<Error = std::fmt::Error>,
{
fn new(iter: I, writer: W, canonical_root_url: Option<&'a str>) -> Self {
Self {
Expand All @@ -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)?;
Expand All @@ -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) => {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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()?;
Expand Down

0 comments on commit 5a2a113

Please sign in to comment.