I’ve been using Marknote for a while and think it has a lot of potential, so thought I’d look into a few issues to help. I’m not sure if Marknote developers hang out here much, but thought I’d try.
One issue I’m looking at is that when I copy text from LibreOffice and paste into Marknote, it preserves style from LibreOffice that is not supported by Marknote (often by Markdown generally). So, for example, take the following in LibreOffice:
I’ve set a custom font here too that isn’t so obvious. I copy and paste that into Marknote and it looks like this (note font is different from the surrounds, and one can’t usually format text like this in Marknote):
If I navigate away from the note and back again, it now looks like this:
The final format is fine, that’s what one would expect (besides the funny character at the end: that’s another issue). Ideally it would just look correct from the outset though.
Now, LibreOffice actually puts a bunch of MIME types on the clipboard when copying:
$ wl-paste --list-types
application/x-openoffice-embed-source-xml;windows_formatname="Star Embed Source (XML)"
text/rtf
text/richtext
text/html
text/markdown
text/plain;charset=utf-16
application/x-openoffice-link;windows_formatname="Link"
application/x-openoffice-objectdescriptor-xml;windows_formatname="Star Object Descriptor (XML)";classname="8BC6B165-B1B2-4EDD-aa47-dae2ee689dd6";typename="LibreOffice 26.2 Text Document";displayname="file:///home/lawrence/Documents/example.odt";viewaspect="1";width="17000";height="3000";posx="0";posy="0"
text/plain;charset=utf-8
text/plain
Marknote prioritises text/html over text/markdown (in rich_documenthandler.cpp, pasteFromClipboard()). That’s easy enough to switch, I tried, it works, but actually it’s not without it’s own complications, because in this case LibreOffice is not preserving all the formatting in the Markdown when putting it on the clipboard!
$ wl-paste --type text/markdown
Lorem **ipsum** *dolor* sit amet.
Note the underline has disappeared (there is no standard underline in Markdown I believe), vs the HTML, which preserves it, but also includes a bunch of style, which is where the different font is coming from:
$ wl-paste --type text/html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title></title>
<meta name="generator" content="LibreOffice 26.2.5.2 (Linux)"/>
<style type="text/css">
@page { size: 21cm 29.7cm; margin: 2cm }
p { margin-bottom: 0.25cm; line-height: 115%; background: transparent }
a:link { color: #000080; text-decoration: underline }
a:visited { color: #800000; text-decoration: underline }
</style>
</head>
<body lang="en-GB" link="#000080" vlink="#800000" dir="ltr"><p style="line-height: 100%; margin-bottom: 0cm">
<font face="Noto Serif, serif">Lorem <b>ipsum</b> <i>dolor</i> <u>sit</u>
amet.</font></p>
</body>
</html>
I have some approaches to improve the situation, but wanted to run them by developers:
- When pasting, it’s very easy to prioritise
text/markdownovertext/htmlwhen available on the clipboard, just swapping a couple of lines. The downside is that some formatting may be lost, as in the underline in this case. - Generally, when pasting any
text/html, one could preprocess the HTML to remove style information:<style>tags and perhapsstyleattributes. I think it would mop up a lot of cases. I was thinking to use QXmlStreamReader to try that and see how it goes.


