oxidecomputer / oxidecomputer/prettier-plugin-asciidoc
The conditional-directive line pattern diverges from ConditionalDirectiveRx in both directions, and a leading-whitespace body's literal reading is lost
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
What happens
CONDITIONAL_DIRECTIVE in src/parse/line-shapes.ts diverges from Ruby's ConditionalDirectiveRx in both directions, with render-moving witnesses (Ruby 2.0.26 and @asciidoctor/core 4.0.11 agree on each):
ifdef::a b[]/___: our target class[^\[]*accepts a space that Ruby's\S*?refuses, so we read a directive where the reference reads paragraph text, and the layout break under it is canonicalized on a line the reference reads inside a paragraph.ifdef::x[a]b[]/___: our text class[^\]]*refuses a]that Ruby's(.+)?accepts, so we read paragraph text where the reference reads a directive with the bodya]b.- A body with LEADING whitespace,
ifdef::backend[ x], is substituted by the reference asxand opens an indented literal block; our reading moves the render (differently before and after the #229/#230/#231 change, which fixed only the trailing-whitespace case).
Pre-existing on main; found by the #229/#230/#231 review (2026-09-06). Fix: spell the pattern from rx.rb's ConditionalDirectiveRx (cite the line), measure the boundary shapes through both programs, and give the substituted body the reference's literal reading when it starts with whitespace.
Contributor guide
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.
Research direction
Start in src/parse/line-shapes.ts and compare CONDITIONAL_DIRECTIVE with ConditionalDirectiveRx in rx.rb, then measure the three boundary cases against Ruby and @asciidoctor/core. Done means the pattern agrees in both directions and a substituted body with leading whitespace receives the reference literal reading, including the render outcomes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100