version 1.5, 2005/05/31 17:41:38
|
version 1.7, 2006/04/06 22:15:18
|
Line 218 sub htmlclean {
|
Line 218 sub htmlclean {
|
} |
} |
# Generate empty tags, remove wrong end tags |
# Generate empty tags, remove wrong end tags |
unless ($blockemptytags) { |
unless ($blockemptytags) { |
$raw=~s/\<(br|hr|img|meta|allow|basefont)([^\>\/]*?)\>/\<$1$2 \/\>/gis; |
$raw=~s/\<(br|hr|img|meta|embed|allow|basefont)([^\>]*?)\>/\<$1$2 \/\>/gis; |
$raw=~s/\<\/(br|hr|img|meta|allow|basefont)\>//gis; |
$raw=~s/\<\/(br|hr|img|meta|embed|allow|basefont)\>//gis; |
|
$raw=~s/\/ \/\>/\/\>/gs; |
unless ($full) { |
unless ($full) { |
$raw=~s/\<[\/]*(body|head|html)\>//gis; |
$raw=~s/\<[\/]*(body|head|html)\>//gis; |
} |
} |
Line 363 sub handler {
|
Line 364 sub handler {
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
|
|
my $html=&Apache::lonxml::xmlbegin(); |
$r->print(&Apache::loncommon::start_page('Cleanup XML Document')); |
$r->print($html.'<head><title>LON-CAPA Construction Space</title></head>'); |
|
|
|
$r->print(&Apache::loncommon::bodytag('Cleanup XML Document')); |
|
$r->print('<h2>'.$fn.'</h2>'. |
$r->print('<h2>'.$fn.'</h2>'. |
'<form action="/adm/cleanup" method="post">'. |
'<form action="/adm/cleanup" method="post">'. |
'<input type="hidden" name="filename" value="'.$env{'form.filename'}.'" />'); |
'<input type="hidden" name="filename" value="'.$env{'form.filename'}.'" />'); |
Line 386 sub handler {
|
Line 384 sub handler {
|
$r->print('</form>'. |
$r->print('</form>'. |
'<br /><a href="/priv/'.$uname.'/'.$fn.'">'.&mt('Back to Source File').'</a>'. |
'<br /><a href="/priv/'.$uname.'/'.$fn.'">'.&mt('Back to Source File').'</a>'. |
'<br /><a href="/priv/'.$uname.'/'.$dir.'">'.&mt('Back to Source Directory').'</a>'. |
'<br /><a href="/priv/'.$uname.'/'.$dir.'">'.&mt('Back to Source Directory').'</a>'. |
'</body></html>'); |
&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
|
|