[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Sat, 07 Apr 2007 00:02:32 -0000
albertel Fri Apr 6 20:02:32 2007 EDT
Modified files:
/loncom/xml lonxml.pm
Log:
- when changing a tag's attributes and intersting something inside of it in one pass, the insert was ignored
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.440 loncom/xml/lonxml.pm:1.441
--- loncom/xml/lonxml.pm:1.440 Thu Feb 22 19:39:35 2007
+++ loncom/xml/lonxml.pm Fri Apr 6 20:02:31 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.440 2007/02/23 00:39:35 albertel Exp $
+# $Id: lonxml.pm,v 1.441 2007/04/07 00:02:31 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -585,17 +585,23 @@
} elsif ($token->[0] eq 'E') {
$currentstring = &Apache::edit::tag_end($target,$token);
}
- } elsif ($target eq 'modified') {
+ }
+ }
+ if ($target eq 'modified' && $nodefault eq '') {
+ if ($currentstring eq '') {
+ if ($token->[0] eq 'S') {
+ $currentstring = $token->[4];
+ } elsif ($token->[0] eq 'E') {
+ $currentstring = $token->[2];
+ } else {
+ $currentstring = $token->[2];
+ }
+ }
if ($token->[0] eq 'S') {
- $currentstring = $token->[4];
$currentstring.=&Apache::edit::handle_insert();
} elsif ($token->[0] eq 'E') {
- $currentstring = $token->[2];
$currentstring.=&Apache::edit::handle_insertafter($token->[1]);
- } else {
- $currentstring = $token->[2];
}
- }
}
}
use strict 'refs';