Changeset 434


Ignore:
Timestamp:
12/14/05 20:20:12 (14 years ago)
Author:
wymsy
Message:

Fixes: remove empty attributes;
remove leading newline added by mozilla (ref ticket #616);
remove trailing br tag added by mozilla.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/GetHtml/get-html.js

    r425 r434  
    5252/*18*/  new RegExp().compile(/(^|<\/(pre|script)>)(\s|[^\s])*?(<(pre|script)[^>]*>|$)/g),//find content NOT inside pre and script tags 
    5353/*19*/  new RegExp().compile(/(<pre[^>]*>)(\s|[^\s])*?(<\/pre>)/g),//find content inside pre tags 
    54 /*20*/  new RegExp().compile(/(^|<!--(\s|\S)*?-->)((\s|\S)*?)(?=<!--(\s|\S)*?-->|$)/g)//find content NOT inside comments 
     54/*20*/  new RegExp().compile(/(^|<!--(\s|\S)*?-->)((\s|\S)*?)(?=<!--(\s|\S)*?-->|$)/g),//find content NOT inside comments 
     55/*21*/  new RegExp().compile(/\S*=""/g) //find empty attributes 
    5556]; 
    5657 
     
    6566                replace(c[12], ' ').//strip contenteditable 
    6667                replace(c[2], '="$2$4$5"$3').//add attribute quotes 
     68                replace(c[21], ' ').//strip empty attributes 
    6769                replace(c[11], function(str, p1, p2) { return ' '+p1.toLowerCase()+p2; }).//lowercase attribute names 
    6870                replace(c[3], '>').//strip singlet terminators 
     
    176178                } 
    177179                if(HTMLArea.is_gecko) 
    178                         html = html.replace(/(.*)<br \/>\n$/, '$1'); //strip trailing <br> added by moz 
     180                        html = html.replace(/(.*)<br \/>\n$/, '$1'). //strip trailing <br> added by moz 
     181                                replace(/^\n(.*)/, '$1'); //strip leading newline added by moz 
    179182                if (outputRoot) { 
    180183                        html += "</" + root_tag + ">"; 
Note: See TracChangeset for help on using the changeset viewer.