[pmwiki-users] How can I prevent pmwiki from automatically changing url text to link?
Patrick R. Michaud
pmichaud at pobox.com
Thu Aug 17 12:08:54 CDT 2006
On Fri, Aug 18, 2006 at 12:49:36AM +0800, Kai Wen wrote:
> Hi.
>
> The process that occurs the problem as the title is a bit complicated.
> First I use a new defined markup to include another page into the current
> page, like
> (:ShowTest:)
> This markup shows the content of Test.Test and more important it replaces
> any word of "$MyInfo" in Test.Test page to an url text, such as
> http://www.google.com. When the content of Test.Test page is like
> [[$MyInfo | Google]]
> In the current page, my new markup function loads the content of Test.Test
> page, replaces all "$MyInfo" in the content into "http://www.google.com"
> which becomes
> [[http://www.google.com | Google]]
> Then the function return MarkupToHTML() of the replaced content of
> Test.Test page to replace the markup (:ShowTest:). I think it should show
> the html as
> <a class='urllink' href='http://www.google.com' rel='nofollow'>Google/a>
> But surprisingly, it shows me that
> <a class='urllink' href='<a class='urllink' href='http://www.google.com'
> rel='nofollow'>http://www.google.com</a>' rel='nofollow'>Google</a>
> It seems that it add link to the url text "http://www.google.com" again!
>
> How can I solve this problem? Maybe prevent it from automatically changing
> the bare url into link?
1. Why not use (:include:) and page variables for this, instead of
creating a custom markup for it?
2. To prevent re-processing of the HTML coming from the (inner) call
to MarkupToHTML(), save the results in a Keep(). In other words,
instead of
$html = MarkupToHTML(...);
use
$html = Keep(MarkupToHTML(...));
Pm
More information about the pmwiki-users
mailing list