• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Hello. My apologies if this is a known issue.

If I create the following link in a top level web (e.g. SomeWeb):

publish turns it into:
Any fix, suggestions, or help would be greatly appreciated. My Lab recently started trying to use TWiki (with PublishContrib) to maintain our public website. Overall, this has been a very smooth process (thank you for the excellent work!). However, this one issue has made it difficult to link to pages within separate webs.
I need you to test, I'm afraid. Please try the following patch:
Index: lib/TWiki/Contrib/Publish.pm
--- lib/TWiki/Contrib/Publish.pm        (revision 9327)
+++ lib/TWiki/Contrib/Publish.pm        (working copy)
@@ -351,14 +351,14 @@
     # Modify relative links
     $ilt = $TWiki::Plugins::SESSION->getScriptUrl(0, 'view', 'NOISE', 'NOISE');
     $ilt =~ s!/NOISE/NOISE.*!!;
-    $tmpl =~ s!(href=["'])$ilt/$web/(\w+)!$1$2.html!g;
-    $tmpl =~ s!(href=["'])$ilt/(\w+/\w+)!$1../$2.html!g;
+    $tmpl =~ s!(href=["'])$ilt/$web(/\w+)+!$1$2.html!g;
+    $tmpl =~ s!(href=["'])$ilt/(\w+(/\w+)+)!$1../$2.html!g;

     # Modify absolute internal view links.
     $ilt = $TWiki::Plugins::SESSION->getScriptUrl(1, 'view', 'NOISE', 'NOISE');
     $ilt =~ s!/NOISE/NOISE.*!!;
-    $tmpl =~ s!(href=["'])$ilt/$web/(\w+)!$1$2.html!g;
-    $tmpl =~ s!(href=["'])$ilt/(\w+/\w+)!$1../$2.html!g;
+    $tmpl =~ s!(href=["'])$ilt/$web/(\w+)+!$1$2.html!g;
+    $tmpl =~ s!(href=["'])$ilt/(\w+(/\w+)+)!$1../$2.html!g;

     # Remove base tag  - DZA
     $tmpl =~ s/<base[^>]+\/>//;
if it works, great. if not, this may take some more work than I have time for....


Thank you so much for the prompt response and patch. Unfortunately this did not quite work. With the patch you provided, publish now turns



WebHome.html (instead of /SomeWeb/SomeWeb1/WebHome.html).

Thanks again for the reply, and I do understand your time constraints. I would greately appreciate the opportunity to test any more ideas you might have.

Please test the latest version I just uploaded.


Many thanks for your continued work on this. The latest version seems to fix some things, but break others.

A link created as follows is now published correctly:


However, any link written using html tags (unfortunately we are required to do this in some situations) now does not get published correctly.

For example,

<a href="SomeTopic">Some Topic</a>

does not get modified and remains:

<a href="SomeTopic">Some  Topic</a>

instead of becoming:

<a href="SomeTopic.html">Some Topic</a>

Please let me know if there's another release I can test.

Thanks again, Devin

<a href="SomeTopic">Some  Topic</a>
is not a valid TWiki link, so I wouldn't expect it to get modified.

Can you please provide a link that used to work but now doesn't?


Disregarding hierarchical webs, with PublishContrib version 9776, an a href tag that points to another page in the wiki is published "correctly."

For example,

<a href="SomeTopic">Some Topic</a>
gets published as
<a href="SomeTopic.html">Some Topic</a>

For our public website, we use href tags because we have different classes of links. Maybe there's a way to specify a class using valid TWiki links ...

Thanks for following up on this, Devin

Hmmm, that's worrying. In that case I appear to have inadvertantly fixed a bug. If I put
<a href="Item666">a link</a>
into a topic I get this: a link which is exactly what should be published (if you view source you will see that it has not received any processing, becuase it is not a topic link).

There is nothing wrong with using A links, but you need to do it like this:

<a href="%SCRIPTURL{view}%/Bugs/Item666" class="fnord">a link</a>
It's a bit more typing, but you will get your links published correctly.

On the other hand, what you describe is a relative link, and it is more useful the way you describe.


Many thanks for the explanation and correction! I guess it sounds like this issue is resolved.

Thanks again for all your work and help. Devin

Summary Support relative A links
ReportedBy TWiki:Main.DevinBougie

SVN Range Mon, 13 Mar 2006 build 9258
AppliesTo Extension
Component PublishContrib
Priority Enhancement
CurrentState Closed

Checkins 9823 9824 9826
TargetRelease n/a
Edit | Attach | Watch | Print version | History: r20 < r19 < r18 < r17 < r16 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r20 - 2006-04-30 - CrawfordCurrie
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback