Skip to content

XWIKI-17010: Code viewer doesn't allow to copy blank lines#5326

Merged
surli merged 1 commit into
xwiki:masterfrom
Sereza5:XWIKI-17010
Jul 8, 2026
Merged

XWIKI-17010: Code viewer doesn't allow to copy blank lines#5326
surli merged 1 commit into
xwiki:masterfrom
Sereza5:XWIKI-17010

Conversation

@Sereza5

@Sereza5 Sereza5 commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Jira URL

https://jira.xwiki.org/browse/XWIKI-17010

Changes

Description

  • Replaced the "empty" lines with a single newline character.

Clarifications

  • The empty lines did not have any text content so they are not kept in the clipboard at all. However, the clipboard adds a newline in between two separate nodes in the copied text. By making sure there's at least a newline character in the "empty line" node, we make sure the clipboard registers it. I don't have sources backing my logic, but in my manual tests it worked well.

Executed Tests

Manual tests on my local instance (both with and without author blame).
Built the change with mvn clean install -f xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-resources -Pquality. Since this is a very niche use case and was quite badly broken, I suppose none of our tests ever relied on copying code from this viewer (in addition, a WCAG scan on the page shows that there's a WCAG contrast error on this UI, it'd have been found by CI if we had any automated test passing on this viewer).

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • 17.10.X (small scope bugfix)

* Replaced the "empty" lines with a single newline character.
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

💚 All backports created successfully

Status Branch Result
stable-17.10.x
stable-18.4.x

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants