No description
Find a file
Miklos Vajna 7f9de46688 cool#8465 clipboard: improve handling of plain text copy, simple case
Currently the current selection is always requested as HTML by the
browser, and then we ask the browser to convert it to plain text.

The problem is that e.g. Writer can produce much better plain text from
its model, compared to the plain text by the browser, e.g. bullet
characters for bullet points.

Fix the problem by:

- CanvasTileLayer.js, _onTextSelectionMsg(): requesting both HTML and
  plain text. Use ',' as a separator, as that's already established,
  e.g. the HTTP Accept header does that already

- Switching the textselectioncontent protocol message from just HTML to
  JSON that contains both HTML and plain text. This is produced in
  ChildSession::getTextSelection() and parsed in CanvasTileLayer.js,
  _onMessage()

- Clipboard.js, setTextSelectionHTML(): allowing setting both HTML and
  plain text.

- ClientSession::postProcessCopyPayload(): knowing if the content to be
  processed is HTML-in-JSON or just HTML, do additional escaping in the
  JSON / textselectioncontent case, but leave the other clipboardcontent
  case unchanged.

So far this only handles the simple case, the behavior for complex
selections are left unchanged for now. The payload is also unchanged
when a single format is requested, as many tests depend on test.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I2fe1378a8d50b7901ac9e808eb78858cd8ff8575
2024-03-08 13:54:10 +00:00
.git-hooks
.github CodeQL C++: use core assets of version 24.04 2024-03-06 20:09:07 +01:00
.gitpod-files Gitpod: update defaults in coolwsd-gitpod.xml 2023-11-15 15:28:48 +01:00
android nearly pure re-factor: split out code into its own modules. 2024-03-06 20:56:55 -05:00
browser cool#8465 clipboard: improve handling of plain text copy, simple case 2024-03-08 13:54:10 +00:00
common Re-factor thread counting into a ThreadCounter class. 2024-03-07 09:36:00 +00:00
cypress_test cool#8465 clipboard: improve handling of plain text copy, simple case 2024-03-08 13:54:10 +00:00
debian Bump version to 23.05.8.4 2024-02-01 16:15:59 +01:00
docker Public key for verifying digital signature of official images from Collabora (cosign) 2024-01-26 15:47:39 +01:00
etc
fuzzer wsd, clientsession: guard against negative w/h in clientvisiblearea 2024-02-26 08:27:21 +00:00
gtk nearly pure re-factor: split out code into its own modules. 2024-03-06 20:56:55 -05:00
indexing
ios ios: blind project file edit to include KitWebSocket.cpp. 2024-03-06 20:56:55 -05:00
kit cool#8465 clipboard: improve handling of plain text copy, simple case 2024-03-08 13:54:10 +00:00
kubernetes/helm Update Helm Chart with new release 23.05.9.3 2024-03-07 13:37:08 +05:30
man Add cli option to use settings from env variables 2023-09-23 12:44:50 +02:00
net killpoco: reduce scope and number of various includes. 2024-03-06 20:56:55 -05:00
scripts Fix warning for unocommands.py 2024-02-06 17:50:09 -05:00
test killpoco: reduce scope and number of various includes. 2024-03-06 20:56:55 -05:00
tools coolmap: annotate hex dumps with memory map names for pointers. 2024-02-29 15:26:34 +00:00
wasm nearly pure re-factor: split out code into its own modules. 2024-03-06 20:56:55 -05:00
wsd cool#8465 clipboard: improve handling of plain text copy, simple case 2024-03-08 13:54:10 +00:00
.cirrus.yml.disabled cirrus FreeBSD 13 is failing 2024-01-23 15:29:08 +01:00
.clang-format
.clang-tidy
.editorconfig Add .editorconfig 2024-03-05 11:29:26 +00:00
.gitignore Add iOS build file to .gitignore 2024-02-08 16:19:47 +01:00
.gitpod.dockerfile
.gitpod.yml
.mailmap
AUTHORS
autogen.sh autogen: conditionally invoke configure at the end 2023-12-19 15:00:34 +01:00
browsersync-config.js
ChangeLog
CODE_OF_CONDUCT.md
config.h.in C++17 Remove checks on std::filesystem 2024-02-22 11:16:28 +01:00
config_version.h.in
configure.ac C++17 Remove checks on std::filesystem 2024-02-22 11:16:28 +01:00
CONTRIBUTING.md
coolkitconfig-mobile.xcu
coolkitconfig.xcu Remove obsolete entry from coolkitconfig.xcu 2024-01-31 09:37:22 +00:00
coolwsd-systemplate-setup copy CA certificates to jail 2023-11-14 17:01:49 +00:00
coolwsd-welcome.xml
coolwsd.service service: change KillMode to mixed 2024-01-16 21:33:52 +01:00
coolwsd.spec.in Add THIRDPARTYLICENSES to rpm package 2024-02-27 10:49:13 +01:00
coolwsd.xml.in wsd: move deprecated logic under legacy_server config 2024-03-02 04:02:26 -05:00
COPYING
discovery.xml
favicon.ico
g
jsstress.in
Makefile.am nearly pure re-factor: split out code into its own modules. 2024-03-06 20:56:55 -05:00
NEWS
PROBLEMS
README.CONTRIBUTING.md Contriburing instructions: add a section on commit messages 2023-09-12 08:45:14 +02:00
README.FILENOTICES.md spdx: improve machine and human readability of headers. 2023-11-14 19:36:31 +00:00
README.md Replace dead chat links 2024-02-09 12:53:09 +00:00
SECURITY.md
THIRDPARTYLICENSES Add THIRDPARTYLICENSES file 2024-02-27 08:59:46 +00:00
trace-event.sample2.json

Open in Gitpod

Collabora Online

Master: Pull request policy

Matrix Telegram Forum Website L10n Gitpod Ready-to-Code

Your own private Office in the Cloud

Get in touch 💬

Key features

  • View and edit text documents, spreadsheets, presentations & more
  • Collaborative editing features
  • Works in any modern browser no plugin needed
  • Open Source primarily under the MPLv2 license. Some parts are under other open source licences, see e.g. browser/LICENSE.

Website

For many more details, build instructions, downloads and more please visit https://collaboraonline.github.io/

Developer assistance

Please ask your questions on any of the bridged Matrix/Telegram rooms

Join the conversation on our Discourse server at https://forum.collaboraonline.com/

Watch the tinderbox status (if it's green) at https://cpci.cbg.collabora.co.uk:8080/job/Tinderbox%20for%20online%20master%20against%20co-22.05/

Development bits

This project has several components:

  • wsd/
    • The Web Services Daemon - which accepts external connections
  • kit/
    • The client which lives in its own chroot and renders documents
  • common/
    • Shared code between these processes
  • browser/
    • The client side JavaScript component
  • test/
    • C++ based unit tests
  • cypress_test/
    • JavaScript based integration tests

Please consult the README files in the component's directory for more details:

iOS and Android apps

See the corresponding READMEs:

GitPod

Head over to https://collaboraonline.github.io/post/build-code/#build-code-on-gitpod and follow the steps.

Enjoy!