nextcloud-libraries / nextcloud-libraries/nextcloud-vue

[NcRichContentEditable] Browser formatting shortcuts format the input field content but not the value

Open
#6,254 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug feature: rich-contenteditable
Dominant language
Vue
Stars
246
Forks
99
Avg merge
1d 20h
Merged PRs (30d)
103

Description

Web-browsers (at least chromium-based) have formatting shortcuts like Ctrl+B (for unknown reasons).

See: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/editing_behavior.cc;l=141-148;bpv=0;bpt=1

This formatting changes HTML content but doesn't change the actual NcRickContenteditable value.

image

Proposals:

  1. Simple - block these shortcuts to not confuse users
  2. Simple + MD support — handle shortcuts to add markdown formatting (like in GitHub)
  3. Complex - parse HTML formatting. This would allow pasting more complex formatted text but probably has a huge list of edge cases

Originally from https://github.com/nextcloud/talk-desktop/issues/907

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 at the NcRichContentEditable component and reproduce the Ctrl+B behavior in a Chromium-based browser. Compare the rendered HTML with the component value, then determine which of the three proposed behaviors the project wants; the issue is done when formatting shortcuts no longer leave the displayed content and value inconsistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
frontend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.