stripFences opens a fence mid line, so some responses render nothing
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Start with packages/lang-core/src/parser/parser.ts and compare stripFences with the fence rules in spec/language.md §1.2. Reproduce the cases using createParser(schema).parse(text) and the schema in spec/fixtures/1.0/library.json; check the streaming parser too. Done means each example produces a Stack with its Text child and no longer returns a blank response.
Written by the indexing model from the issue text.
Description
Describe the bug
stripFences in lang-core (packages/lang-core/src/parser/parser.ts) treats three backticks anywhere on a line as an opening fence, and skips over double quoted text even in prose outside fences... When that happens the program gets cut up and the whole response renders blank. No error is reported.
Spec 1.0 (spec/language.md, §1.2) says a fence opens only at the start of a line, and that quotes in prose outside fences don't shield anything.
To Reproduce
Parse either of these with createParser(schema).parse(text), using the schema from spec/fixtures/1.0/library.json:
- A stray
"in prose before the fence:
Here is a 12" pizza card:
```
root = Stack([a])
a = Text("Pizza")
```
- Backticks mentioned mid-line in prose:
Tip: use ```js for code.
```
root = Stack([a])
a = Text("ok")
```
Two more cases that render nothing:
a = Text('Wrap code in ``` fences')with no fencesroot = Stack([a]) // fenced with ```with no fences (this one givesno-root)
Expected behavior
Each one renders Stack with its Text child, as the spec describes.
Actual behavior
root is null and errors is empty, so the user sees a blank response. The streaming parser gives the same result.
Environment
- Package:
@openuidev/lang-core1.0.1 (main @ c0e6b0f9) - Node 22
Additional context
Happy to send a fix with tests if this direction sounds right
- Dominant language
- TypeScript
- Stars
- 10k
- Forks
- 698
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 133
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from thesysdev/openui
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
thesysdev/openui#1445 · 2 comments ·
Maintainers usually reply within 1 day
-
Add dataInvention flag to PromptOptions to disable the 'generate realistic/plausible data' ruleOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
thesysdev/openui#959 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 18/100
thesysdev/openui#1528 · 1 reaction ·
Maintainers usually reply within 1 day
All issues in thesysdev/openui
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
unocss/unocss#5421 · 1 comment ·
Maintainers usually reply within 1 day
-
needs-area
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Azure/typespec-azure#5936 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 72/100
vercel-labs/scriptc#2910 ·
Maintainers usually reply within 1 day
-
automation missing-model model-sync provider:fireworks-ai
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anomalyco/models.dev#12458 ·
Maintainers usually reply within 1 day