torchbox / torchbox/wagtail-tinytableblock

Normalize non-breaking spaces

Open
#26 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10
Forks
4
Avg merge
1h 4m
Merged PRs (30d)
1

Description

When pasting tables non-breaking spaces can be inserted and cause issues with formatting or converting data to other formats like CSV. Microsoft Word seems to be particularly aggressive with replacing all spaces with  .

We could address this in 2 different ways.

  1. Strip all non-breaking spaces from table content
  2. Update the paste_postprocess js method to strip non-breaking spaces from pasted content, but allow users to insert them manually into the table.

Happy to look at either of these if there's an opinion as to which should be implemented.

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 paste_postprocess JavaScript method and the table paste or formatting tests, if present. Compare the two proposed handling approaches, then verify that pasted non-breaking spaces no longer disrupt table formatting or conversion to CSV while the chosen behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.