Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/cargo/thiserror-2.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
rodneylab authored Dec 9, 2024
2 parents ae964ba + a2cdefe commit beedf26
Show file tree
Hide file tree
Showing 8 changed files with 311 additions and 315 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
version: 8
version: 9
- name: Install Node dependencies
run: pnpm install
- name: Check Format
Expand Down
2 changes: 2 additions & 0 deletions .yamlfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exclude:
- pnpm-lock.yaml
12 changes: 6 additions & 6 deletions Cargo.lock

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

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: 5e420860f9476779457dcdd2d889abf9802f2938
// source-hash: f28def7121bbab3494416ee9b34fe483428d17ad
let wasm;

const heap = new Array(128).fill(undefined);
Expand Down Expand Up @@ -50,18 +50,6 @@ 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 @@ -127,6 +115,18 @@ 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,9 +319,6 @@ 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 @@ -362,6 +359,9 @@ 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.
16 changes: 13 additions & 3 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,19 @@ type MarkdownToPlaintextOptions = Omit<MarkdownToHtmlOptions, "searchTerm">;
* Markdown Parser.
*
* @param markdown The Markdown text to parse
* @param options.enableSmartPunctuation `true` if "something" should be replaced with
* “something”, etc.
* @returns `markdown` parsed into HTML as an object or an error object. If successful, the HTML is
* @param {Object} [options={}] - Parse options
* @param {boolean} options.enableSmartPunctuation - `true` if "something" should be replaced with
* “something”, etc.
* @param {string} options.canonicalRootUrl - if included, relative url gain this value as a prefix
* (`/home` becomes `https://example.com/home`)
* @param {string} options.searchTerm - if included, output HTML wraps any instances of this value
* in `mark` tags (`A senctence with the-search-term` becomes
* `A sentence with <mark>the-search-term</mark>`), for use in
* highlighting search results, with CSS, for example. The
* first instance also has `id=search-match` added the mark
* tag. You might use this to scroll the first match into view
* automatically.
* @returns {Object} `markdown` parsed into HTML as an object or an error object. If successful, the HTML is
* in the `.html` field of the returned object.
*/
const markdownToHtml: (
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"devDependencies": {
"@rodneylab/parsedown": "link:pkg",
"husky": "^9.1.7",
"prettier": "^3.3.3",
"vitest": "^2.1.5"
"prettier": "^3.4.2",
"vitest": "^2.1.8"
},
"type": "module"
}
Loading

0 comments on commit beedf26

Please sign in to comment.