[LON-CAPA-cvs] cvs: rat / lonpage.pm
raeburn
raeburn at source.lon-capa.org
Fri Mar 6 15:04:01 EST 2020
raeburn Fri Mar 6 20:04:01 2020 EDT
Modified files:
/rat lonpage.pm
Log:
- Support jumping to an item in a composite page from the Contents listing
where the item is an external resource containing an anchor.
Index: rat/lonpage.pm
diff -u rat/lonpage.pm:1.137 rat/lonpage.pm:1.138
--- rat/lonpage.pm:1.137 Thu Mar 5 19:24:35 2020
+++ rat/lonpage.pm Fri Mar 6 20:04:01 2020
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Page Handler
#
-# $Id: lonpage.pm,v 1.137 2020/03/05 19:24:35 raeburn Exp $
+# $Id: lonpage.pm,v 1.138 2020/03/06 20:04:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -368,7 +368,7 @@
if (($hash{'encrypted_'.$_}) && ($symb) && (!$env{'request.role.adv'})) {
$showsrc .= '?symb='.&Apache::lonenc::encrypted($symb);
} elsif ($anchor) {
- $showsrc .= $anchor
+ $showsrc .= $anchor;
}
$ssibody{$_} = <<ENDEXT;
<iframe src="$showsrc" width="100%" height="300px">No iframe support!</iframe>
@@ -947,7 +947,12 @@
if (($hash->{'encrypted_'.$rid}) && (!$env{'request.role.adv'})) {
$aname = 'LC_'.$rid;
} else {
- $aname = &escape($symb);
+ my $shownsymb = $symb;
+ if ($symb =~ /\#([^\#]+)$/) {
+ my $escan = &escape('#');
+ $shownsymb =~ s/#([^\#]+)$/$escan$1/;
+ }
+ $aname = &escape($shownsymb);
}
my $metainfo = '<a name="'.$aname.'"></a>';
unless ($env{'request.role.adv'}) {
More information about the LON-CAPA-cvs
mailing list