Semantic line breaks and consuming the space before a dash
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 56.1k
- Forks
- 1.7k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Description
Description
For writers who use Semantic Line Breaks and em-dashes, there is a question of whether and how to set the dash open: “word — word” or closed: “word—word”. Many style guides, including the AP, prefer open. It is also natural in French and German to set the em-dash open. But the majority, including Oxford and Chicago, prefer closed.
In Typst, it is trivial to set the dash open by writing
One idea per line
— and another one here.
Which gives “One idea per line — and another one here.”
Yet it is not possible to observe semantic line breaks and set the dash closed.
One idea per line
—and another one here.
This gives us “One idea per line —and another one here.”
In TeX, we can use % to consume the space produced by the semantic line break:
One idea per line%
—and another one here.
Which produces the desirable, yet not currently possible in Typst, “One idea per line—and another one here.”
#710
#792
Impetus on Stack Overflow
Use Case
This feature is useful for writers who observe semantic line breaks and want to use em-dashes.
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 by reviewing issues #710 and #792, then reproduce the semantic line-break examples from this issue in Typst. Trace where line breaks become spaces and determine how an author could consume that space before an em-dash. Done means the closed-dash example produces “One idea per line—and another one here.” while ordinary semantic line breaks retain their current behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100