diff --git a/.changeset/popular-moles-tie.md b/.changeset/popular-moles-tie.md new file mode 100644 index 000000000..f3039673b --- /dev/null +++ b/.changeset/popular-moles-tie.md @@ -0,0 +1,5 @@ +--- +"myst-directives": patch +--- + +Switch to browser parsing for csv diff --git a/docs/tables.md b/docs/tables.md index 5856d6ba2..0b64ce1d0 100644 --- a/docs/tables.md +++ b/docs/tables.md @@ -66,6 +66,7 @@ The {myst:directive}`list-table` directive is used to create a table from data i The {myst:directive}`csv-table` directive is used to create a table from comma-separated values (CSV) data. Block markup and inline markup within cells is supported. Line ends are recognized within quoted cells. +````{myst} ```{csv-table} Frozen Delights! :header: "Treat", "Quantity", "Description" @@ -74,6 +75,7 @@ Block markup and inline markup within cells is supported. Line ends are recogniz it wouldn't be crunchy, now would it?" "Gannet Ripple", 1.99, "On a stick!" ``` +```` ## Complex Tables with Style diff --git a/packages/myst-directives/src/table.ts b/packages/myst-directives/src/table.ts index 5f46f66ae..b8a47e104 100644 --- a/packages/myst-directives/src/table.ts +++ b/packages/myst-directives/src/table.ts @@ -7,7 +7,7 @@ import type { } from 'myst-common'; import { fileError, normalizeLabel, RuleId } from 'myst-common'; import type { VFile } from 'vfile'; -import { parse } from 'csv-parse/sync'; +import { parse } from 'csv-parse/browser/esm/sync'; import { select } from 'unist-util-select'; export const tableDirective: DirectiveSpec = {