Skip to content

Commit

Permalink
remove </?unstructured_citation> earlier, so ending punctuation on ur…
Browse files Browse the repository at this point in the history
…ls can be recognized

git-svn-id: svn://tug.org/tugboat/trunk@617 7237770a-693a-0410-b4d3-c34f48dbc3f6
  • Loading branch information
kberry committed Nov 16, 2024
1 parent bf0f670 commit c408745
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
6 changes: 6 additions & 0 deletions capsules/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2024-11-16 Karl Berry <karl@freefriends.org>

* cr-landing-bbl-abs (read_crossref_xml): remove
</?unstructured_citation> early, so our check for [., ] at the end
of a url is effective.

2024-11-15 Karl Berry <karl@tug.org>

* tb140capsule.txt (mittelbach-tagging24.pdf): primary category
Expand Down
18 changes: 10 additions & 8 deletions capsules/cr-landing-bbl-abs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Usage: $0 [CROSSREF.xml] [CROSSREF_WORKING_DIR]
In CROSSREF_WORKING_DIR/*.html (Crossref landing) files,
1) replace bibliography placeholders with the actual bbl text
taken from CROSSREF.xml, and also
2) replace abstract placeholds with the abstract texts taken from
taken from CROSSREF.xml, including making urls live, and also
2) replace abstract placeholders with the abstract texts taken from
CROSSREF_WORKING_DIR/ARTICLE.abs.
END_USAGE
exit ($ARGV[0] ne "--help");
Expand Down Expand Up @@ -121,12 +121,16 @@ sub update_landing_bbl {
my $newcite = "";
for my $word (split (" ", $cite)) {
#warn "checking $word\n";
my ($w1,$w2);

# remove the crossref element.
$word =~ s,</?unstructured_citation>,,g;

# try to detect http(s) urls, with or without a protocol,
# possibly followed by a period or comma.
my ($prot,$urlbase) = "";

# used conditionally below to save capture groups.
my ($w1,$w2);

# protocol is specified.
if ($word =~ m!^https?://!) {
($prot,$urlbase) = ($word =~ m!^(https?)://(\S+)!);
Expand Down Expand Up @@ -170,14 +174,12 @@ sub update_landing_bbl {
my $url = "$prot://$urlbase";
$newcite .= qq!<a href="$url">$urlbase</a>!;
} else {
# As a second horrible special case, insert a line break
# before bullets (used in tb136andre bbl).
# Special case: insert a line break (in both html source
# and output) before bullets (used in tb136andre bbl).
$newcite .= "\n<br>" if $word =~ /^&#x2022;/;
$newcite .= $word;
}
}
# remove the crossref element.
$newcite =~ s,</?unstructured_citation>,,g;
print $temp_fh "<li class=\"tugbbl\">$newcite</li>\n";
}
print $temp_fh "</ol>\n";
Expand Down

0 comments on commit c408745

Please sign in to comment.