otterwiki icon indicating copy to clipboard operation
otterwiki copied to clipboard

Copying to/from the Markdown editor copies visible line numbers into the clipboard

Open tmcallahan59 opened this issue 1 month ago • 3 comments

Summary When copying text either from the Otter Wiki Markdown editor or into the Markdown editor from another editor instance, the copied text includes visible line numbers. This results in unwanted numbers and blank lines appearing in other applications or within Otter Wiki after paste.

Steps to reproduce

  1. Open Otter Wiki and go to a page with the Markdown editor open (edit mode).

A. Copying from the editor

  • Add or open a page and enter edit mode.
  • Select text in the editor and copy it to the clipboard.
  • Paste into a plain-text app (e.g., Notepad, TextEdit, another editor, or a GitHub issue).
  • Observe that the pasted text includes line numbers.

B. Pasting between two Otter Wiki editors

  • Open another page in Otter Wiki and enter edit mode.
  • Copy text from one editor (as in case A).
  • Paste it into the second editor.
  • Notice that instead of clean text, a new line appears where each line number was previously visible.

Actual behavior The pasted content includes the editor’s line numbers as literal text, often separated by blank lines.
Example:

### initframs

6

​

7

> Update causes un-writeable `/efi/boot`

8

​

9

Reproduce:

10

​

11

1. Run update and upgrade

Expected behavior Copying from the editor should place only the underlying text content on the clipboard (no line numbers or extra blank lines).
Pasting between editors should preserve text exactly as shown in the source editor.


Environment

  • Otter Wiki version: Version 2.14.1 (v2.14.1-0-g3b236aa)
  • Browser: Firefox (144.0.2)
  • OS: Running on Pop!OS 22.04 through Docker 28.5.2

tmcallahan59 avatar Nov 07 '25 15:11 tmcallahan59

Hey @tmcallahan59, thanks for reaching out. This error sounds annoying.

I can not reproduce the error. When I copy from the editor there are no line numbers in the paste.

https://github.com/user-attachments/assets/419b6371-96b1-48a7-80d5-78e66d229b23

I tested the following Browser/OS:

  • Firefox 144.0.2 on MacOS 15.6.1 and Windows 11
  • Chrome 141.0.7390.55 on MacOS 15.6.1
  • Chrome 141.0.7390.125 on Windows 11
  • Brave 1.84.135 on Windows 11

redimp avatar Nov 07 '25 23:11 redimp

Maybe that’s it; I’m on Pop!_OS. Just tested on both Chrome and Brave, in addition to mobile firefox and safari, and I wasn’t able to reproduce the issue, so isolated to Firefox and Linux

tmcallahan59 avatar Nov 08 '25 00:11 tmcallahan59

I some more tests ... was not able to reproduce the bug in Pop!_OS with Firefox 144.0.2.

https://github.com/user-attachments/assets/4cfea257-5f80-486b-bd33-96ac8918d055

redimp avatar Nov 08 '25 21:11 redimp