Comments (6)
@jcormier
You're absolutely right.. My solution is wrong and your patch is working fine!
I have fixed the 0.5.3 with the correct code.
Thank you for the contribution! 😃
from redmine_shortcuts.
Hi @jcormier
Nice catch!
This is affecting only textile and looks related to the </pre>
tag.
I am going to release a bug fix.
from redmine_shortcuts.
While your patch works, I still think it's wrong and very hacky. I don't see any reason that selectionEnd would depend on the length of the text added after the selection, these offsets are all relative to the start of the text box, it should only depend on the prepend length as my proposed patch does.
Only the slicing really cares about the length of the append text...
from redmine_shortcuts.
The selected text on the textarea depends on both prepended and appended tags.
- Create a new issue and focus the text area
- Write some text
- Select the text (CTRL + A)
- Add the preformatted tags (CTRL + P)
- The entire text is selected
from redmine_shortcuts.
Existing Text - Selected start = 0, end = 13
After pre
pre text - pre.length = 8
Existing Text - Selected start = 0 + 8, end = 13 + 8
post text - post.length = 9
It doesn't matter how large post text is, the selection start/end positions stay the same
from redmine_shortcuts.
Note: Should have added +1 to pre and post lengths for newlines..., but it doesn't change the math.
from redmine_shortcuts.
Related Issues (9)
- Ctrl+C triggers "Ticket copy" HOT 2
- Problem at login page HOT 2
- redmine 4.2.3: ctrl-shift-p inserts pre tags when not expected HOT 2
- Plugin prints javascript error when redmine is hosted in subdirectory HOT 2
- Feature Request: Let Admin enable/disable each shortcut individually HOT 2
- QuestionMark integration proposal HOT 2
- [feature] "Code" shortcut HOT 9
- Polish localization
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redmine_shortcuts.