observablehq / observablehq/plot

easier copying of tip contents?

Open
#1,853 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
HTML
Stars
5.4k
Forks
244
PR merge metrics
No merged PRs in 30d

Description

Copying the contents of this tip

Plot.tip(["lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum"]).plot({height:300})

results in zero-width whitespaces and words seem glued together lorem ipsum lorem ipsum lorem ipsum​lorem ipsum lorem ipsum lorem ipsum​lorem ipsum

The insertion of zwsp in
https://github.com/observablehq/plot/blob/30d6c9006978c85732ce969ec288f5b7f4b7a82f/src/marks/tip.js#L195
is meant to prevent words across newlines from being selected as one word.

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 in src/marks/tip.js at line 195 and reproduce the issue with the Plot.tip example in the report. Inspect the copied text to confirm where zero-width spaces are inserted and verify the intended selection behavior. Done means tip contents copy with normal word spacing while preserving the stated selection purpose.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.