Page 2 of 2

Re: How do I copy links from a word doc into a post?

Posted: Mon Dec 12, 2016 11:42 pm
by leosmith
For specific questions you will want to take time to visit our forum either as a guest or by becoming an active member of our community.
I cut and pasted this. The word "forum" should be a link, right?

Re: How do I copy links from a word doc into a post?

Posted: Mon Dec 12, 2016 11:54 pm
by jeff_lindqvist
Yeah, if the word was a link.

By the way, Tomgosses' post works but that's probably because the whole url is visible - and that has never been a problem. If I highlight something in a sentence which has a "magic url" somewhere, and copy-paste it, only the text is pasted. (GoogleChrome)

Re: How do I copy links from a word doc into a post?

Posted: Tue Dec 13, 2016 12:55 am
by leosmith
jeff_lindqvist wrote:Yeah, if the word was a link.

By the way, Tomgosses' post works but that's probably because the whole url is visible - and that has never been a problem. If I highlight something in a sentence which has a "magic url" somewhere, and copy-paste it, only the text is pasted. (GoogleChrome)

Yeah, I think you're right. I'll probably copy paste from word, toggle all the hyperlinks in the word doc, and paste the addresses into the correct places in the post to create text links in this forum. Thanks for your help.

Re: How do I copy links from a word doc into a post?

Posted: Tue Dec 13, 2016 10:33 am
by Doitsujin
@leosmith:

Why don't you give my method a try? It'll save you a lot of work.

If you save a word doc as a filtered html doc and open it with a text editor, a paragraph with a link in it will look like this in the html file:

Code: Select all

<p class=MsoNormal>Here's link to Google <a href="http://google.com/">Google</a></p>

Since the forum software doesn't understand HTML code, you'll need to replace HTML code with BBCode and delete unneeded tags.

If you search for </*p[^>]*> and replace it with nothing, you'll get:

Code: Select all

Here's link to Google <a href="http://google.com/">Google</a>

Now all you have to do is replace the href tags with BBCode tags by searching for <a href="([^"]+)">([^<]+)</a> and replacing it with [url=\1]\2[/url], and you'll end up with:

Code: Select all

Here's link to Google [url=http://google.com/]Google[/url]

This method works with all editors that support regular expressions, e.g. Notepad ++ or TextWrangler if you have a Mac.

Re: How do I copy links from a word doc into a post?

Posted: Tue Dec 13, 2016 11:16 am
by jeff_lindqvist
Doitsujin wrote:Why don't you give my method a try? It'll save you a lot of work.


Indeed, Find/Replace is a useful tool.

Re: How do I copy links from a word doc into a post?

Posted: Tue Dec 13, 2016 6:35 pm
by leosmith
Doitsujin wrote:@leosmith:
Why don't you give my method a try? It'll save you a lot of work.

Thanks for your solution. I've never worked with a script editor, so what seems trivial to you isn't for me. Anyway, I tried it and got stuck, as I suspected I would. I could ask a bunch of questions and eventually get un-stuck, but I'd rather just do the links by hand to save time.