Alternative Information Directory
Coronavirus information & resources
Vaccines - What You Need To Know

Format Link - a sweet Firefox extension for copying and formatting page links, titles and text

Format Link, which i just now used to grab that link, is a really handy Firefox add-on that makes it super easy to copy a webpage title, link, any selected text, and format it for pasting in different formats such as Markdown, BB code, HTML and others. I used it to create all of my News Bytes posts which would have taken much longer without it.

Using any article in one of my News Byte posts as an example, they are of course built by going to the article source page, highlighting an excerpt, and pressing my assigned hotkey to activate Format Link. In one shot the add-on accomplishes all of the following:

  • copies the page title enclosed in h2 HTML tags and hyperlinks it
  • copies any text i have highlighted and wraps it in HTML blockquote and p tags
  • adds the "more..." hyperlink
  • replaces all fancy quotes with their plain equivalents
  • and it does all this using the proper mime type for pasting directly into the TinyMCE visual editor, such as is used for ClassicPress

The format i use to accomplish this is...

<h2><a href="{{page_url}}">{{title}}</a></h2>\n<blockquote><p>{{text.s("\\n+","</p><p>")}}</p></blockquote>\n<p><a href="{{page_url}}">more...</a></p>

The quotes replacement is done using a regular expression...


Even being familiar with regular expressions, It took a little fooling around to figure out the syntax for the search and replace stuff ( <variable>.s("<search string>","<replace string>") ), but Format Link makes the rest quite easy.

Granted there are several other Firefox add-ons that can copy page titles and potentially hyperlink them, but few can also copy highlighted text in addition, and fewer still have an option to set the mime type so that the text can be pasted into something like the TinyMCE visual editor, and fewer still provide options to replace text using regular expressions.

There's a couple small caveats to Format Link at present; 1) you can only create 9 formats and 2), there's no way to easily rearrange them, such as by drag & drop, however the developer is aware of these shortcomings and neither one is a show-stopper unless you must have more than 9 formats.

If you often copy web content for pasting on forums, social media or text documents, or compile news articles such as i do (on a very irregular basis), check out Format Link (GitHub repo) for sure. It's a great time saver.

Lastly, the developer, Hiroaki Nakamura, is a nice guy and responsive to feedback.

Leave a Reply

Your email address will not be published. Required fields are marked *