Quantcast

A URL that isn't a link

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

A URL that isn't a link

CLOSE Dave
If I have a URL (http://...) in a macro variable that I want to appear
on a wiki page, I can just write it in the code. But if I want it to
display as plain text, not as a link to the URL, that doesn't seem
possible. (For example, the URL may be bogus so following a link to it
could actually be harmful, or the URL could be incomplete so following a
link to it could result in an error.)

I can write the URL itself directly and bound it with verbatim tags and
that works. But then the variable isn't expanded and I really want to
use the variable.

    * Set MYURL = "http://example.com/"

    * Begin your link with "%MYURL%" and then ...

I want the value of %MYURL% in the second line to appear as plain text,
not as a link.

The reason the value is a variable is so that it can be used multiple
places. Some of those places expect to use the value as part of an
active link ("%MYURL%/dir/file"). The %MYURL% value by itself is not a
valid link so I don't want it look like one when displayed alone.

I understand that Foswiki's determination of when to make text into a
link automatically is based on the LinkProtocolPattern configuration
variable. But I can't find any way to override that variable for a
single page or part of a page.

Solution?
--
Dave Close
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A URL that isn't a link

Michael Tempest
Dave

There are two things I would try.
A. Insert <nop> into the url to break the autolinking e.g.
http<nop>://bogus.%FOO%
B. Enclose the link in <literal> tags: <literal><a href="http://bogus.%FOO%">http://bogus.%FOO%</literal>

Good luck
Michael

On 9/4/13, CLOSE Dave <[hidden email]> wrote:

> If I have a URL (http://...) in a macro variable that I want to appear
> on a wiki page, I can just write it in the code. But if I want it to
> display as plain text, not as a link to the URL, that doesn't seem
> possible. (For example, the URL may be bogus so following a link to it
> could actually be harmful, or the URL could be incomplete so following a
> link to it could result in an error.)
>
> I can write the URL itself directly and bound it with verbatim tags and
> that works. But then the variable isn't expanded and I really want to
> use the variable.
>
>     * Set MYURL = "http://example.com/"
>
>     * Begin your link with "%MYURL%" and then ...
>
> I want the value of %MYURL% in the second line to appear as plain text,
> not as a link.
>
> The reason the value is a variable is so that it can be used multiple
> places. Some of those places expect to use the value as part of an
> active link ("%MYURL%/dir/file"). The %MYURL% value by itself is not a
> valid link so I don't want it look like one when displayed alone.
>
> I understand that Foswiki's determination of when to make text into a
> link automatically is based on the LinkProtocolPattern configuration
> variable. But I can't find any way to override that variable for a
> single page or part of a page.
>
> Solution?
> --
> Dave Close
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
> _______________________________________________
> Foswiki-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
>

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A URL that isn't a link

CLOSE Dave
I wrote:

> If I have a URL (http://...) in a macro variable that I want to appear
> on a wiki page, I can just write it in the code. But if I want it to
> display as plain text, not as a link to the URL, that doesn't seem
> possible. (For example, the URL may be bogus so following a link to it
> could actually be harmful, or the URL could be incomplete so following a
> link to it could result in an error.)
>
> I can write the URL itself directly and bound it with verbatim tags and
> that works. But then the variable isn't expanded and I really want to
> use the variable.
>
>      * Set MYURL = "http://example.com/"
>
>      * Begin your link with "%MYURL%" and then ...
>
> I want the value of %MYURL% in the second line to appear as plain text,
> not as a link.
>
> The reason the value is a variable is so that it can be used multiple
> places. Some of those places expect to use the value as part of an
> active link ("%MYURL%/dir/file"). The %MYURL% value by itself is not a
> valid link so I don't want it look like one when displayed alone.
>
> I understand that Foswiki's determination of when to make text into a
> link automatically is based on the LinkProtocolPattern configuration
> variable. But I can't find any way to override that variable for a
> single page or part of a page.

Michael Tempest answered:
 > There are two things I would try.
 > A. Insert <nop> into the url to break the autolinking e.g.
 > http<nop>://bogus.%FOO%
 > B. Enclose the link in <literal> tags: <literal><a href="http://bogus.%FOO%">http://bogus.%FOO%
 > </literal>

Thanks. But...

B. I already said I tried <literal>. The variable is not expanded.

A. Putting <nop> into the value would screw-up any use of the variable
as part of an actual URL.
--
Dave Close, Thales Avionics, Irvine California USA.
cell +1 949 394 2124, [hidden email]
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A URL that isn't a link

Lynnwood Brown
Dave,
Maybe I'm missing something but it appears that answer to your question is simple: just put "<nop>" prior to your custom macro in places where you want the link to display as plain text.

So, define your macro without any quotes:
   * Set MYURL = http://example.com/

...and add "<nop>" before macro where you want it to display as non-link:
   * Begin your link with "<nop>%MYURL%" and then ...

It seemed to work for me. Give it a try.
Cheers,
Lynnwood
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A URL that isn't a link

CLOSE Dave
Lynnwood Brown wrote:

> Maybe I'm missing something but it appears that answer to your
> question is simple: just put "<nop>" prior to your custom macro in
> places where you want the link to display as plain text.
>
> So, define your macro without any quotes:
>     * Set MYURL = http://example.com/
>
> ...and add "<nop>" before macro where you want it to display as
> non-link:
>     * Begin your link with "<nop>%MYURL%" and then ...
>
> It seemed to work for me. Give it a try.

It surprised me but this did work. As the <nop> was outside the variable
reference, I would not have expected it to affect the expansion.
Fortunately, it does, so my issue is now resolved.

Thanks.
--
Dave Close, Thales Avionics, Irvine California USA.
cell +1 949 394 2124, [hidden email]
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Foswiki-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/foswiki-discuss
Loading...