Copy-pasting within a verbatim code block introduces newlines
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zim |
Fix Released
|
Undecided
|
Unassigned | ||
zim (Ubuntu) |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
To replicate
=========
1) Create a multiline verbatim code block with
'''
code hre
''''
2) Reload page to format correctly.
3) Select the "e" in code, and copy to clipboard.
4) Move cursor between "h" and "r" and paste.
Expected results
==============
Source should look like this:
'''
code here
''''
Observed results
==============
Source looks like this:
'''
code h
'''
''ere''
If you reload the page, you can see this results in a newline before the pasted "e", and the following code is also changed to "in-line" verbatim.
This is particularly problematic if you forget this bug exists, and forget to reload. If you attempt to copy edited code and paste into a terminal, you can potentially execute the wrong code, as the invisible newline is inserted in the clipboard.
For example… (DON'T DO THIS)
'''
sudo rm -rf /local/
'''
Oh, I got the path wrong! I'll just copy "usr/" and paste it before "local". Then, I'll copy the whole command and paste it into a terminal!
Obviously, here, `sudo rm -rf /` will be executed immediately, as the newline is parsed.
ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: zim 0.60-1
Uname: Linux 3.11.8-
ApportVersion: 2.12.5-0ubuntu2.2
Architecture: amd64
Date: Mon Mar 31 16:25:53 2014
InstallationDate: Installed on 2012-12-16 (469 days ago)
InstallationMedia: Kubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.1)
MarkForUpload: True
PackageArchitec
SourcePackage: zim
UpgradeStatus: Upgraded to saucy on 2013-10-18 (164 days ago)
Tested in current dev branch and result is just a single line as in the Expected Result.
Flagging as fix committed, please re-open if still seen in dev branch or later in 0.61 and up