Tip: One-click copy selected text to [article] format

Mick West

Administrator
Staff member
The [article] format is a useful way of quoting a snippet from web page, and looks like this.

Article:
FULTON COUNTY, Ga. -- According to Fox 5, Fulton County has a delay with processing and counting tens of thousands of absentee ballots due to a pipe break in the State Farm Arena.


To do this by hand you use code like:
[article=https://wgxa.tv/news/beyond-the-podium/pipe-burst-at-state-farm-arena-causes-delay-in-absentee-vote-counts-in-fulton-county]FULTON COUNTY, Ga. -- According to Fox 5, Fulton County has a delay with processing and counting tens of thousands of absentee ballots due to a pipe break in the State Farm Arena.[/article]

However an easier way is to add a bookmarklet to your browser, with the code in the attached zip file. (I can't post it here as Cloudflare, my CDN thinks it's phishing code and blocks it)

The simplest way to do this is to create a bookmark, then edit it, rename it to something like [article] and then copy in the code.

Then just highlight the text you want, and click the bookmarklet, and then paste into a post. Magic!
 

Attachments

  • article-bookmarklet.txt.zip
    1 KB · Views: 139
Last edited:

Mendel

Senior Member.
I can't find a button for it on the toolbar; that's why I type the code manually.
I like it because it lets me neatly attribute my quotes with a link to the source.
 

deirdre

Senior Member.
where in the code can i change the "article" heading to "external source"? or can i not do that? (sometimes it's not really an article being quoted)
 

Mick West

Administrator
Staff member
where in the code can i change the "article" heading to "external source"? or can i not do that? (sometimes it's not really an article being quoted)
All of the code that makes the link is in the one line:

Code:
var markdown = '[article=' + window.location.href + ']'+window.getSelection().toString()+'[/article]';

If you make a version replacing that line with

Code:
var markdown = window.location.href + '\n[ex]'+window.getSelection().toString()+'[/ex]';

It will give you it in ex form, with the URL above it.

The \n is a newline.
 

Related Articles

Top