Skip to content

Commit c9ec7f2

Browse files
🧮 Add support for parsing decimal numbers in si role (#2600)
Co-authored-by: Rowan Cockett <[email protected]>
1 parent 2dfefe8 commit c9ec7f2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/stale-apes-shave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"myst-roles": patch
3+
---
4+
5+
Add support for parsing decimal numbers in si role

packages/myst-roles/src/si.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const siRole: RoleSpec = {
99
},
1010
run(data: RoleData): GenericNode[] {
1111
const value = data.body as string;
12-
const match = value.match(/([0-9]+)\s?<([\\a-zA-Z\s]+)>/);
12+
const match = value.match(/([0-9.,eE-]+)\s?<([\\a-zA-Z\s]+)>/);
1313
if (!match) {
1414
return [{ type: 'si', error: true, value }];
1515
}

0 commit comments

Comments
 (0)