From 715e7189d728b0b16880c31d14f9f7b2819c227b Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 12 Oct 2009 15:33:23 +0000 Subject: [PATCH 1/1] source: support whitespace before module reference In `require Some::Module` the module name includes leading space (unlike `use` where it belongs to the preceding construct). Support this so that such references will be linked as well. --- source.plp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source.plp b/source.plp index bc8423b..1f3c600 100644 --- a/source.plp +++ b/source.plp @@ -64,8 +64,8 @@ foreach (@$parsed) { if ($_->[0] eq 'Constant' and $_->[1] =~ s/^(')([a-z0-9_.]+\.plp?)(?=\1$)//) { printf '%s%s', $1, "/source/$2", $2; } - if (!$_->[0] and $_->[1] =~ s/^([A-Z]\w+(?:::\w+)+)(?![^;\s])//) { - printf '%s', "/source/$1", $1; + if (!$_->[0] and $_->[1] =~ s/^(\s*)([A-Z]\w+(?:::\w+)+)(?![^;\s])//) { + printf '%s%s', $1, "/source/$2", $2; } print Text::VimColor::_xml_escape($_->[1]); print "" if $tag; -- 2.30.0