From: Mischa POSLAWSKY Date: Mon, 12 Oct 2009 15:33:23 +0000 (+0000) Subject: source: support whitespace before module reference X-Git-Tag: v1.3~122 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/715e7189d728b0b16880c31d14f9f7b2819c227b 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. --- 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;