We are currently planning to migrate to a different platform for the forum. We will announce this fact both here and on Twitter, once we have settled on a solution.

pasted text (almost) always has HTML

Hello, I have been trying to find a way to organize my thoughts and notes. Zettlr has a lot going for it especially linking, footnotes and citations.

However I find the way it accepts paste of text really prevents any work getting done. I read the docs and also found this thread which I am not quite certain is related.

Anything pasted from the web is at minimum preceded by something like

<meta http-equiv="content-type" content="text/html; charset=utf-8">

I tried pasting and re copying via Typora (which has been a useful workaround for this sort of thing in the past). But it's actually worse because for some reason it copies style information from the theme in Typora (if you change the theme, you get different code). So for example a single line from the manual page turns into this:

<span md-inline="plain" class="md-plain md-expand" style="box-sizing: border-box;">Refer to the section on </span>

<span md-inline="link" class=" md-link" style="box-sizing: border-box;"><a spellcheck="false" href="https://docs.zettlr.com/en/reference/shortcuts/" style="box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;"><span md-inline="plain" class="md-plain" style="box-sizing: border-box;">Shortcuts</span></a><span md-inline="plain" class="md-plain md-expand" style="box-sizing: border-box;">, to get a list of all available shortcuts.</span></span>

However if I enter "source code mode" in Typora before copying, it does what it should, which is

Refer to the section on [Shortcuts](https://docs.zettlr.com/en/reference/shortcuts/), to get a list of all available shortcuts.

Going via TextEdit is even worse:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta http-equiv="Content-Style-Type" content="text/css">


<meta name="Generator" content="Cocoa HTML Writer">

<meta name="CocoaVersion" content="1671.6">

<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 12.0px Times; color: #000000} span.s1 {font-kerning: none} span.s2 {text-decoration: underline ; font-kerning: none; color: #346eb7} </style>

<span class="s1">Refer to the section on <a href="https://docs.zettlr.com/en/reference/shortcuts/"><span class="s2">Shortcuts</span></a>, to get a list of all available shortcuts.</span>

Copying from a PDF file yields similar results.

I have never encountered this strange behavior before. Usually programs either try to convert the formatting (seldom perfectly) or strip it. Pasting with basic formatting is such a fundamental part of collecting information.

The Joplin web clipper has the best web to text editor conversion I've ever encountered. I don't know what it does internally but it's fantastic.

Other than this, Zettlr stands above all the other options available. I tried to work with it (because nothing's perfect) to see if I could get used to it but I ended up opening everything in Typora all the time, which means none of the the great zettlr stuff works.

So if there is a workaround or a solution or a future feature I'd love to know about it.

thank yoU!!!


  • Hey, yeah, this is actually pretty common. Web browsers always don't copy the simple HTML but add all the styles AND ADD THEM TO SPANS!

    I've been driven crazy by this; there's no actual fault on Zettlr's or Showdown's side (the latter is the library we use for converting HTML -> Markdown). Everytime I try to copy from web I simply paste it as plain Text.

    There are two major problems preventing from finding a good solution:

    1. Browsers add a lot of unnecessary styling
    2. Most websites produce such a shitty code that they don't use the correct semantic tags (for instance, <blockquote> for blockquotes and <p> for paragraphs). Sometimes you see something like <div class="header-1"> and there is simply NO WAY for any program to recognize that this should be a heading.

    Funny thing: The latter problem is precisely for why I began writing Zettlr, because I am really disgusted by the way some people simply style headings to look as if they were headings, without actually telling the program "This is a heading!"

    But, as should have become clear: I'm well aware of the problem as I'm affected myself and I will solve it!

Sign In or Register to comment.