7

How can formatting from websites (e.g. Etymonline and Wiktionary always contains bolds, italics, underlining, hyperlinks) be copied and pasted, or efficiently replicated? I yearn to avoid pasting only the text and then formatting myself anew.

  • Good question... Word has a markdown viewer in Review, but that might not help. – Tim May 4 '15 at 21:38
  • 6
    Just watch out for Jeff Atwood. – user259867 May 4 '15 at 22:47
  • We all have the same problem. Another related on is copy and pasting text which includes hyperlinks. It would be very nice to keep both the URL and the text of the link. – John Saunders May 4 '15 at 23:38
  • I asked this in general on SuperUser: superuser.com/q/909620/269574 – Greek - Area 51 Proposal Jul 31 '15 at 13:31
  • Most proposals you try to promote, including the one in your display name, are deleted. Better clean this up, I think. – Shadow The Dragon Wizard Dec 24 '17 at 8:58
4

At present, I copy and paste with the right cursor on the mouse, but then I must unproductively add * * to each italicised phrase, and ** ** to each bolded phrase. How can I improve this?

There are browser extensions that allow you to copy formatted text to the clipboard as markdown. For instance, you can use this extension on Chrome:

https://chrome.google.com/webstore/detail/copy-as-markdown/dgoenpnkphkichnohepecnmpmihnabdg?hl=en

Here's one for Safari:

http://crateofpenguins.com/blog/2013-3-service-safari-selection-to-clipboard-as-markdown-quote

And if you're on OS X you'll want to take a look at these markdown tools:

http://brettterpstra.com/projects/markdown-service-tools/

Which provide a great deal of flexibility in converting to and from markdown from a variety of other formats and services.

It is unlikely that Stack Exchange will provide these services.

5

Data on the clipboard frequently has multiple types. You can see how this works when you use Paste Special in Microsoft Word:

Paste special example

These data types are called MIME types, or sometimes Content-types. Here are some example text types that are defined:

  • text/asp
  • text/css
  • text/html
  • text/javascript
  • text/plain
  • text/richtext

The application that is receiving the paste, such as Microsoft Word or the question editing panel has to know what to do with a particular content type.

Now, consider the fact the text syntax we use (e.g. **text**) formats text using a method called Markdown, which converts the syntax to HTML. Similarly, JIRA uses its own syntax to convert plain text to HTML formatted text.

Now, consider the problem that would be faced: when pasting, Stack Exchange would have to somehow capture the HTML formatted text and then use that to re-generate Markdown syntax, from a source that could be generated from anywhere, not just another Markdown interpreter. Can you imagine how difficult that process might be? This is especially true when you begin to consider CSS: some sites might use <b></b> for bold, and other sites might use CSS and <div></div> for everything, and there are still other ways to do it. HTML and CSS are, themselves, complicated programming languages, not parseable by regex.

The bottom line is, this would be a very difficult problem. Further, there is a lot of pushback against doing it in the first place (Thanks @HomegrownTomato) this will almost certainly never happen on Stack Exchange.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .