New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] v5.8.8 pod2html -- Convert RFC links to point ot IETF pages #8820
Comments
From @jaaltoCreated by jaalto@cante.cante.netThe manual pages many times have references to the internet standards, See RFC 822 and HTTP protocol RFC 2616 The following patch converts these to point to corresponding official Note, that this patch build on top of my previous patch titled: === modified file 'Html.pm' Inline Patch--- Html.pm 2007-03-04 00:43:23 +0000
+++ Html.pm 2007-03-04 11:53:59 +0000
@@ -1538,10 +1538,29 @@
sub process_text {
return if $Ignore;
my( $tref ) = @_;
- my $res = process_text1( 0, $tref );
+ my $res;
+ $res = process_text1( 0, $tref );
$$tref = $res;
}
+sub process_text_rfc_links {
+ my $text = shift;
+
+ # For every "RFCnnnn" or "RFC nnn" link it to the authorative
+ # source. Do not use (i) option here. Require RFC to be written in
+ # in capital letters.
+
+ $text =~ s{
+ (?=^\S) # positive lookahead, make dure this is "text" paragraph
+ (.*?) # $1: Grab leading text
+ (?<=[^<>]) # Make sure this is not an URL already
+ (RFC\s*(\d{1,5}))\b # max 5 digits
+ }
+ {$1<a href="http://www.ietf.org/rfc/rfc$3.txt">$2</a>}gx;
+
+ $text;
+}
+
sub process_text1($$;$$){
my( $lev, $rstr, $func, $closing ) = @_;
my $res = '';
@@ -1730,6 +1749,8 @@
} else {
warn "$0: $Podfile: undelimited $func<> in paragraph $Paragraph.\n" unless $Quiet;
}
+
+ $res = process_text_rfc_links($res);
}
return $res;
} Perl Info
|
From @jaaltoA small improvement to original patch. The regexp must not match: rfc225.txt The following patch maked end boundary more strict. Jari === modified file 'Html.pm' Inline Patch--- Html.pm 2007-03-04 11:55:55 +0000
+++ Html.pm 2007-03-04 17:47:19 +0000
@@ -1554,7 +1554,7 @@
(?=^\S) # positive lookahead, make dure this is
|
@jaalto - Status changed from 'new' to 'open' |
From @jaaltoRsynced to the latest Html.pm as of today 2007-03-14. Here is patch === modified file 'Html.pm' Inline Patch--- Html.pm 2007-03-14 18:50:47 +0000
+++ Html.pm 2007-03-14 18:53:22 +0000
@@ -1505,6 +1505,24 @@
$$tref = $res;
}
+sub process_text_rfc_links {
+ my $text = shift;
+
+ # For every "RFCnnnn" or "RFC nnn" link it to the authorative
+ # source. Do not use (i) option here. Require RFC to be written in
+ # in capital letters.
+
+ $text =~ s{
+ (?=^\S) # positive lookahead, make dure this is "text" paragraph
+ (.*?) # $1: Grab leading text
+ (?<=[^<>]) # Make sure this is not an URL already
+ (RFC\s*(\d{1,5}))(?=\s) # max 5 digits
+ }
+ {$1<a href="http://www.ietf.org/rfc/rfc$3.txt">$2</a>}gx;
+
+ $text;
+}
+
sub process_text1($$;$$){
my( $lev, $rstr, $func, $closing ) = @_;
my $res = '';
@@ -1693,6 +1711,7 @@
} else {
warn "$0: $Podfile: undelimited $func<> in paragraph $Paragraph.\n" unless $Quiet;
}
+ $res = process_text_rfc_links($res);
}
return $res;
} |
@rgs - Status changed from 'open' to 'resolved' |
From @rgarciaOn 14/03/07, Jari Aalto <jari.aalto@cante.net> wrote:
Thanks, applied as #30604 to bleadperl. |
From @tamiasOn Fri, Mar 16, 2007 at 04:18:40PM +0100, Rafael Garcia-Suarez wrote:
I should have sent this feedback sooner, sorry... On Wed, Mar 14, 2007 at 09:56:14PM +0300, Jari Aalto wrote:
Patches are easier to apply if you use the full path from the base
I wasn't sure what you meant by "(i) option" at first; I would call it the
This regex will only match the first RFC reference in the first line of the I don't think the positive lookahead to make sure it's a "text" paragraph Also, why do you require whitespace after the number? This will fail to Try something like this instead: $text =~ s{
return $text; Ronald |
From @jaaltorjk-perl-p5p@tamias.net (Ronald J Kimball) writes:
I'm working in localized version control directory, which does not (cd lib/Pod/ && patch -p0 < /path/to/that.patch)
Thanks, here is updated patch (rsync'd against latest bledperl 2007-03-17) Jari === modified file 'Html.pm' Inline Patch--- Html.pm 2007-03-17 07:44:10 +0000
+++ Html.pm 2007-03-17 08:07:05 +0000
@@ -1509,16 +1509,14 @@
my $text = shift;
# For every "RFCnnnn" or "RFC nnn" link it to the authoritative
- # source. Do not use (i) option here. Require RFC to be written in
+ # source. Do not use /i modifier here. Require RFC to be written in
# in capital letters.
$text =~ s{
- (?=^\S) # positive lookahead, make sure this is "text" paragraph
- (.*?) # Grab leading text
- (?<=[^<>]) # Make sure this is not an URL already
- (RFC\s*(\d{1,5}))(?=\s) # max 5 digits
+ (?<=[^<>[:alpha:]]) # Make sure this is not an URL already
+ (RFC\s*(\d{1,5}))(?!\d) # max 5 digits
}
- {$1<a href="http://www.ietf.org/rfc/rfc$3.txt">$2</a>}gx;
+ {<a href="http://www.ietf.org/rfc/rfc$3.txt" class="rfc">$1</a>}gx;
$text;
} |
From nospam-abuse@bloodgate.com-----BEGIN PGP SIGNED MESSAGE----- Moin, On Saturday 17 March 2007 01:19:25 Ronald J Kimball wrote:
[snip]
The return is surely superfluous? Or is there any case where it makes a It might be good to be consistent in the code, though. All the best, Tels - -- This email violates EU patent EP0394160: [ ########## 66% #### -----BEGIN PGP SIGNATURE----- iQEVAwUBRfvLJ3cLPEOTuEwVAQLA5Qf/UpGoIk/M3D5f5z52DaFWBd9r8nQkPP21 |
From @rgarciaOn 17/03/07, Jari Aalto <jari.aalto@cante.net> wrote:
Thanks, applied as #30631. |
Migrated from rt.perl.org#41691 (status was 'resolved')
Searchable as RT41691$
The text was updated successfully, but these errors were encountered: