diff options
author | Fred Drake <fdrake@acm.org> | 2001-04-12 04:03:22 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-04-12 04:03:22 (GMT) |
commit | e0197bfaeb4cf189d0a0ee22f52a073c577a0c0f (patch) | |
tree | fa10b77204545dfc2fe798560a82749e4525acb2 /Doc | |
parent | fd09e86109605e9070b3b9e0b24c7a173b28bb0e (diff) | |
download | cpython-e0197bfaeb4cf189d0a0ee22f52a073c577a0c0f.zip cpython-e0197bfaeb4cf189d0a0ee22f52a073c577a0c0f.tar.gz cpython-e0197bfaeb4cf189d0a0ee22f52a073c577a0c0f.tar.bz2 |
When forming the <A> tag for a \seepep or \seerfc, make sure we strip
HTML markup from the string used as the title in the TITLE attribute.
This fixes formatting in the "What's New in Python 2.1" document.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/perl/python.perl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Doc/perl/python.perl b/Doc/perl/python.perl index 98a1dcf..20615cc 100644 --- a/Doc/perl/python.perl +++ b/Doc/perl/python.perl @@ -1497,6 +1497,14 @@ sub do_cmd_seemodule{ . $_; } +sub strip_html_markup($){ + my $str = @_[0]; + my $s = "$str"; + $s =~ s/<[a-zA-Z0-9]+(\s+[a-zA-Z0-9]+(\s*=\s*(\'[^\']*\'|\"[^\"]*\"|[a-zA-Z0-9]+))?)*\s*>//g; + $s =~ s/<\/[a-zA-Z0-9]+>//g; + return $s; +} + sub handle_rfclike_reference{ local($_, $what, $format) = @_; my $rfcnum = next_argument(); @@ -1504,9 +1512,10 @@ sub handle_rfclike_reference{ my $text = next_argument(); my $url = get_rfc_url($rfcnum, $format); my $icon = get_link_icon($url); + my $attrtitle = strip_html_markup($title); return '<dl compact class="seerfc">' . "\n <dt><a href=\"$url\"" - . "\n title=\"$title\"" + . "\n title=\"$attrtitle\"" . "\n >$what $rfcnum, <em>$title</em>$icon</a>" . "\n <dd>$text\n </dl>" . $_; |