-
-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copying raw text includes a bunch of QT formatting rules #817
Comments
I'm sorry, that's the way Qt handles that in a QPlainTextEdit. If your destination where you paste the text can handle rich text it will get rich text. Usually the destination decides if plain or rich text is used while pasting. But you should be able to be able to copy plain text to the clipboard pretty easily with the help of the scripting engine. There are the parts that you need: |
If you create a script you can make a pull requests at https://github.com/qownnotes/scripts |
Hm... I tried to paste text from the QOwnNotes note edit panel to LibreOffice Writer or an online editor and didn't get any formatting or "QT formatting rules"... How did you manage to get those (and please fill out the full issue template)? |
@pbek, I pasted it into a web browser wysiwyg editor on a blogging platform, more specifically TinyLetter (I believe it uses the CKE editor). It shows when I switch to the "show source" view. If I have a document like this:
Then it results in:
|
It seems that the editor pastes the rich-text of the clipboard as html and not as rich-text... I can't do anything about that. What happens if you copy and paste text from a webpage in a webbrowser? |
Same thing, which is to be expected. But isn't there something that can be configured so that just plain text is copied by default? You said the component name was QPlainTextEdit, shouldn't it then support plain text when copied? |
Yes, and every other rich text editor interprets the pasted text as plain-text... |
Do you reckon it should be reported as an upstream bug? |
Of course you could try... |
Hmm, yeah. I figured that other editors might simply be filtering out the incorrect formatting but when I'm pasting it into Gedit I get just the plain text as well. I guess this issue might be just affecting a too specific use case. Feel free to close this issue if you want to, I'll work around this when using the Tinyletter web service by copy-pasting into gedit before I put it into the web wysiwyg editor. |
Hello there, I MIGHT have kind of the same issues: The text renders as pictured in the screen shot. Using the <> (greater/lower than) mixes up the rendering. Looking up the ">", I see that's the HTML Escape code for said lower/greater than. I think it worked a few versions ago; I've just started using QOwnnotes. Rendering the same code directly via Plantuml works as expected, see graphics below. BTW: I'm amazed at how easy this is compared to Evernote whilst giving me a feature set EN can't dream aboout :) Best regards, |
I'm not exactly sure what you did. This current "issue" was about pasting text from QOwnNotes into a special online editor.
Hehe, I'm happy you like it. :) Were you using a script to get the rendering in your screenshot on the right side? |
Yeah, I could have elaborated a little bit more on that… Right now I checked if there's anything else in Plantuml, that would be rendered the wrong way - and found some: I don't really know how where to go from here/if this might be a bug with render-plantuml, QPlainTextEdit, or Plantuml (which works when started from a command line in the directory with the files, rendering them as it should). |
@nikhilw, you did |
@andreas-breitbach I guess it would be best to open an issue at https://github.com/qownnotes/scripts/issues |
I am able to reproduce this issue. Will work on it. @andreas-breitbach, it would be easier to track it if you could add it to scripts repository as @pbek suggested. @nsrosenqvist I have seen similar behaviour when copying text or code from certain IDEs as well, like Eclipse/Idea. What you are doing, pasting into a plain text editor and copying from there to remove the mark-up is what is needed sometimes. |
Expected behaviour
Copying the text from the editor should copy it as raw text without formatting rules (since rules are defined as markdown)
Actual behaviour
When I copy from the editor into a web browser (e.g. a blog post) I get a bunch of extra tags that seem to contain QT formatting rules for every paragraph.
Comments
Since it's a markdown text it's assumed that there shouldn't styling rules copied as well since the rules are defined in the text data. It's also not a rich text editor so even if it wasn't markdown then these rules shouldn't be included on copy.
The text was updated successfully, but these errors were encountered: