nisus.com
https://www.nisus.com/forum/

Make hyperlinks from HTML
https://www.nisus.com/forum/viewtopic.php?f=17&t=4863
Page 1 of 1

Author:  chazzo [ 2012-03-09 04:18:52 ]
Post subject:  Make hyperlinks from HTML

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

Author:  martin [ 2012-03-09 13:50:35 ]
Post subject:  Re: Make hyperlinks from HTML

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 309 times

Author:  chazzo [ 2013-02-21 04:13:28 ]
Post subject:  Re: Make hyperlinks from HTML

Martin: for some reason I missed your reply. I'm sorry not to have thanked you before. That's very useful!

Author:  martin [ 2013-02-21 19:12:59 ]
Post subject:  Re: Make hyperlinks from HTML

No problem, I'm glad it was helpful!

Author:  nareng [ 2013-03-23 06:07:36 ]
Post subject:  Re: Make hyperlinks from HTML

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

Author:  nareng [ 2013-03-23 06:22:04 ]
Post subject:  Re: Make hyperlinks from HTML

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

Author:  martin [ 2013-07-02 10:08:52 ]
Post subject:  Re: Make hyperlinks from HTML

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.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/