Page 1 of 2

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

Posted: Mon Dec 12, 2016 1:27 am
by leosmith
I have a word document with text and many links in it, and I'd like to copy/paste all the text into a post here, but when I try to do this the links disappear.

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

Posted: Mon Dec 12, 2016 4:43 am
by aokoye
Testing: http://www.ravelry.com

edit: what do you mean by the links disappear? I typed that into a .docx file saved it, and copied and pasted it into here. This behavior, the hyperlink being clickable (so being a hyperlink), when it's typed (or copied and pasted) into textbox is default for this software. For further clarification - you're not going to find a clickable link when you're typing it into the textbox before hitting submit. Once you hit submit it becomes clickable.

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

Posted: Mon Dec 12, 2016 10:02 am
by Doitsujin
leosmith wrote:I have a word document with text and many links in it, and I'd like to copy/paste all the text into a post here, but when I try to do this the links disappear.
Save the MS Word doc as a filtered web page, then open the HTML page with Notepad ++ (or another text editor with regex support) and search and replace the folllowing:

Find what:</*p[^>]*>
Replace with:

Find what:<a href="([^"]+)">([^<]+)</a>
Replace with:[url=\1]\2[/url]

This should allow you to copy and paste the remaining text into the input form.

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

Posted: Mon Dec 12, 2016 1:22 pm
by jeff_lindqvist
aokoye wrote:edit: what do you mean by the links disappear?


I'm sure leosmith referred to documents where the actual URL is covered by a word or sentence, just like many posts on this forum, Wikipedia and just about any web page out there. (<----see what I did here)

Such texts usually lose formatting and links when pasted into simple text boxes.

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

Posted: Mon Dec 12, 2016 3:56 pm
by aokoye
jeff_lindqvist wrote:
aokoye wrote:edit: what do you mean by the links disappear?


I'm sure leosmith referred to documents where the actual URL is covered by a word or sentence, just like many posts on this forum, Wikipedia and just about any web page out there. (<----see what I did here)

Such texts usually lose formatting and links when pasted into simple text boxes.

I didn't think that it was terribly common for people to create text links in word files which is why I asked for the clarification. Then again what do I do with most of my Word files? Print them out. I generally have the frustration of making sure that hyperlinks don't show up for the sake of formatting.

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

Posted: Mon Dec 12, 2016 6:54 pm
by leosmith
jeff_lindqvist wrote:I'm sure leosmith referred to documents where the actual URL is covered by a word or sentence, just like many posts on this forum, Wikipedia and just about any web page out there. (<----see what I did here)

Such texts usually lose formatting and links when pasted into simple text boxes.

Yes, that's what I meant. I like to use these word-links in my word doc because it looks better, and because on some forums I've been able to paste them directly into the text box and retain the link. Is that a possible thing to request as a feature here?

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

Posted: Mon Dec 12, 2016 7:28 pm
by jeff_lindqvist
It's one thing that web email services (Hotmail, Gmail etc.) and certain email clients (Thunderbird e.g.) can parse it correctly, but a common answer in various threads from phpbb.com, is that Word (and other word processors) produce a lot of hidden code which first of all isn't necessary and secondly can give you unwanted results. I've seen a whole web site crash due to some copy/pasted text from Word. Hence, "Paste without formatting" is a preferred option in cms/wysiwyg tools. Do the formatting later.

Maybe there's a phpbb patch that can do what you want, but until we know, you're better off creating the links again after pasting the whole text (or following Doitsujin's find/replace advice).

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

Posted: Mon Dec 12, 2016 7:30 pm
by rdearman
Or just save the document as html, open with a web-browser and then copy and paste. That should work.

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

Posted: Mon Dec 12, 2016 10:56 pm
by leosmith
rdearman wrote:Or just save the document as html, open with a web-browser and then copy and paste. That should work.

That was one of the first things I tried.

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

Posted: Mon Dec 12, 2016 11:30 pm
by tomgosse
leosmith wrote:
rdearman wrote:Or just save the document as html, open with a web-browser and then copy and paste. That should work.

That was one of the first things I tried.

Works for me:
This is a word doc with a link: http://www.language-learners.org