Changeset 296


Ignore:
Timestamp:
08/26/05 06:19:49 (9 years ago)
Author:
niko
Message:

#438
alert when tidy fails, so not all html is lost

Location:
trunk/plugins/HtmlTidy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/HtmlTidy/html-tidy-logic.php

    r289 r296  
    5959                $jsMakeSrc .= "\tns += '" . str_replace("'","\'",$line) . "\\n';\n"; 
    6060        } 
     61if(!sizeof($srcLines)) { 
     62    echo "alert(HTMLArea._lc('Tidy failed.  Check your HTML for syntax errors.', 'HtmlTidy'));\n"; 
     63} else { 
    6164?> 
    6265var ns=""; 
    6366<?php echo $jsMakeSrc; ?> 
    6467editor.setHTML(ns); 
     68<? } ?> 
  • trunk/plugins/HtmlTidy/html-tidy.js

    r60 r296  
    9191    { 
    9292      var oldhtml = editor.getHTML(); 
     93      if(oldhtml=="") break; //don't clean empty text 
    9394      // Ask the server for some nice new html, based on the old... 
    9495      HTMLArea._postback(_editor_url + 'plugins/HtmlTidy/html-tidy-logic.php', {'htisource_name' : oldhtml}, 
Note: See TracChangeset for help on using the changeset viewer.