Reply to topic  [ 7 posts ] 
Make hyperlinks from HTML 
Author Message
User avatar

Joined: 2011-10-27 03:40:31
Posts: 25
Location: Norfolk, UK
I have a document that's full of hyperlinks in full HTML form:

Code:
... for more information see <a href="http://example.com">this fine website</a>.


and I'd like to convert these to embedded NWP links:

Quote:
... for more information see this fine website.


Could some kind person suggest a macro to do this?

I guess the macro would need to handle the case where the link text is the same as the URL:

Code:
... for more information see <a href="http://example.com">http://example.com</a>.


and it might also be handy to have the option of converting plain URLs without the full <a href=...>...</a>:

Code:
http://example.com


Would anyone else find this useful?

Thanks
Charles


2012-03-09 04:18:52
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
I'm attaching a macro that scans for the kinds of links you describe. It's a little picky about its matching, eg: the opening <a> tag must not have any other attributes besides "href", and the URL must be enclosed in straight quote marks. But hopefully you find it useful!


Attachments:
Link Using HTML Tags.nwm [18.67 KiB]
Downloaded 310 times
2012-03-09 13:50:35
Profile WWW
User avatar

Joined: 2011-10-27 03:40:31
Posts: 25
Location: Norfolk, UK
Martin: for some reason I missed your reply. I'm sorry not to have thanked you before. That's very useful!


2013-02-21 04:13:28
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
No problem, I'm glad it was helpful!


2013-02-21 19:12:59
Profile WWW

Joined: 2013-03-23 06:02:11
Posts: 2
Hello Martin,
Thank you very much for the HTML Macro!

When I write papers, my citation software (Bookends) is able to output:

<a href=”http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=23207973 “>PubMed Link</a>

When I run your macro, the URL is made into a link.
Might you have a Macro that links 'PubMed Link' with the URL (http://www.ncbi.nlm.nih.gov/entrez/quer ... s=23207973)


Thank you very much for any of your help!

Naren


2013-03-23 06:07:36
Profile

Joined: 2013-03-23 06:02:11
Posts: 2
Hello Martin,

I am looking for a Macro for creating HTML link from <a href="http://abc">PubMedLink</a>, so that there is a link for "PubMed link' created using "http://abc" but, "http://abc" does not appear on the document. Do you have a Macro to do this, please?

Thank you

Naren


2013-03-23 06:22:04
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
Hi Naren: I'm not sure I quite follow what you're trying to accomplish. Would you be able to attach a Nisus Writer file that shows a single example of the text before any link scanning takes place, and also shows the text how you'd like it to appear after a macro scan? The example wouldn't need to be a full document, just a snippet so it's clear what exactly you want to accomplish.


2013-07-02 10:08:52
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: Bing [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software