-
-
Notifications
You must be signed in to change notification settings - Fork 21
added handling of parens in datastream values #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,11 +73,11 @@ function App() { | |
|
|
||
| // Parse for chart (existing logic) | ||
| if (line.trim().startsWith('#')) { | ||
| const names = line.replace(/^\s*#+\s*/, '').split(/[\s,\t]+/).filter(Boolean) | ||
| const names = line.replace(/^\(/, '').replace(/\)$/, '').replace(/^\s*#+\s*/, '').split(/[\s,\t]+/).filter(Boolean) | ||
|
||
| if (names.length > 0) store.setSeries(names) | ||
| return | ||
| } | ||
| const parts = line.trim().split(/[\s,\t]+/).filter(Boolean) | ||
| const parts = line.trim().replace(/^\(/, '').replace(/\)$/, '').split(/[\s,\t]+/).filter(Boolean) | ||
|
||
| if (parts.length === 0) return | ||
| const values: number[] = [] | ||
| for (const p of parts) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parentheses removal logic should be applied after the hash symbol removal, not before. The current order may incorrectly handle cases where parentheses are part of the hash prefix (e.g., '#(data)'). Consider reordering:
line.replace(/^\s*#+\s*/, '').replace(/^\(/, '').replace(/\)$/, '')