Skip to content

Commit

Permalink
🐛 Change CSV parser to use the browser (#1142)
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 authored Apr 19, 2024
1 parent 464307f commit ddb29b0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/popular-moles-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"myst-directives": patch
---

Switch to browser parsing for csv
2 changes: 2 additions & 0 deletions docs/tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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!"
```
````

## <span style="background: -webkit-linear-gradient(20deg, #09009f, #E743D9); -webkit-background-clip: text; -webkit-text-fill-color: transparent;">Complex Tables with Style</span>

Expand Down
2 changes: 1 addition & 1 deletion packages/myst-directives/src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit ddb29b0

Please sign in to comment.