mattdesl / mattdesl/word-wrapper

Line breaking should use Unicode line breaking algorithm

Open
#1 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
72
Forks
8
PR merge metrics
No merged PRs in 30d

Description

The rules for breaking lines are more complicated than a naive test against white space (for instance, en-dashes and em-dashes are valid points to break text on, although they're not whitespace): this library should use the UAX #14 line-breaking logic provided by the NPM [linebreak](https://www.npmjs.com/package/linebreak) module (see the [canwrap](https://github.com/stuartpb/canwrap/blob/master/index.js) library for an example implementation).

Contributor guide

No contributing guide indexed for this repository

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 reviewing the current line-breaking implementation in word-wrapper and the canwrap index.js example referenced in the issue. Compare that approach with the NPM linebreak module and UAX #14 behavior; the work is done when wrapping follows Unicode line-breaking opportunities, including non-whitespace points such as en-dashes and em-dashes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
content
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.