speced / speced/respec

Add !!type and |text to [^element^] shorthand

Open
#5,272 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
806
Forks
434
Avg merge
1d 21h
Merged PRs (30d)
32

Description

The [^element^] shorthand (ReSpec's HTML-safe equivalent of Bikeshed's <{element}>) currently infers the link type from structure but doesn't support explicit type disambiguation or display text override.

For consistency with other ReSpec bracket shorthands ([= =], {{ }}), add:

Type disambiguation:

  • [^ iframe!!element ^] — explicit element type
  • [^ input/type!!element-attr ^] — explicit element-attr type
  • Valid types: element, element-attr, attr-value, element-state, element-sub

Display text:

  • [^ iframe|the iframe element ^] — custom display text

All existing behavior unchanged (no breaking changes).

Part of the Bikeshed inline shorthand parity effort.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the parser or entry point for the [^element^] shorthand and compare it with the existing [= =] and {{ }} shorthand handling. Add support for !! type disambiguation and | display text for the listed element reference types, while preserving current inference and behavior. Done means all examples work without breaking existing shorthand syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.