[MKDoc-commit] [1.6] Patch from Sam to make internal links relative
to the document
chris at mkdoc.demon.co.uk
chris at mkdoc.demon.co.uk
Mon Sep 19 10:11:16 BST 2005
Log Message:
-----------
[1.6] Patch from Sam to make internal links relative to the document root
Tags:
----
mkdoc-1-6
Modified Files:
--------------
mkd/flo:
Editor.pm
-------------- next part --------------
Index: Editor.pm
===================================================================
RCS file: /var/spool/cvs/mkd/flo/Editor.pm,v
retrieving revision 1.12.2.48
retrieving revision 1.12.2.49
diff -Lflo/Editor.pm -Lflo/Editor.pm -u -r1.12.2.48 -r1.12.2.49
--- flo/Editor.pm
+++ flo/Editor.pm
@@ -185,6 +185,15 @@
my $class = "mkdoc-link-" . ( $link_component->is_internal ?
"internal" : "external" );
+ if ($link_component->is_internal) {
+ # strip off the public domain for internal documents.
+ # This results in a link which will work on both the
+ # public and user domains. This matches the
+ # pre-LinkParser behavior where all internal links
+ # were relative.
+ $url =~ s!^$ENV{PUBLIC_DOMAIN}(.*)$!/$1!;
+ }
+
# setup target to open a new window in needed
my @target;
if (MKDoc::Config->EXTERNAL_LINKS_OPEN_IN_NEW_WINDOW() and
More information about the MKDoc-commit
mailing list