Changeset 478 for trunk/plugins/GetHtml


Ignore:
Timestamp:
03/22/06 17:27:37 (14 years ago)
Author:
wymsy
Message:

Add an override function to fix the situation where if location.href includes a query string with an '&' in it, fixRelativeLinks failed to strip the url from self-named anchors in IE.

File:
1 edited

Legend:

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

    r468 r478  
    7878                replace(c[8], '<').//strip tagstart whitespace 
    7979                replace(c[10], ' ');//trim extra whitespace 
    80         if(HTMLArea.is_ie && c[13].test(sHtml)) {// 
     80        if(HTMLArea.is_ie && c[13].test(sHtml)) { 
    8181                sHtml = sHtml.replace(c[13],'$1'+this.stripBaseURL(RegExp.$3)+'"'); 
    8282        } 
     
    195195}; 
    196196 
     197//fix obscure case; stripSelfNamedAnchors fails in IE if location.href includes a query string with '&' in it 
     198HTMLArea.prototype._origFixRelativeLinks = HTMLArea.prototype.fixRelativeLinks; 
     199HTMLArea.prototype.fixRelativeLinks = function(html) 
     200{ 
     201  if(typeof this.config.stripSelfNamedAnchors != 'undefined' && this.config.stripSelfNamedAnchors) 
     202  { 
     203    var stripRe = new RegExp(document.location.href.replace(/&/g,'&amp;').replace(HTMLArea.RE_Specials, '\\$1') + '(#[^\'" ]*)', 'g'); 
     204    html = html.replace(stripRe, '$1'); 
     205  } 
     206  html = this._origFixRelativeLinks(html); 
     207  return html; 
     208}; 
     209 
    197210//override (hack) outwardHtml() to handle onclick suppression 
    198211HTMLArea.prototype._origOutwardHtml = HTMLArea.prototype.outwardHtml; 
Note: See TracChangeset for help on using the changeset viewer.