[TYPO3-english] news_feedit problem with html tags in rte field

Brian Bendtsen bb at bellevuevej.dk
Fri Feb 5 10:16:22 CET 2010


Brian Bendtsen skrev:
> Hi
> 
> I have read a lot of posts about this problem but no solutions yet. Can 
> this be true?
> 
> The news_feedit lets you create news records from frontend with a rte 
> field for the bodytext.
> 
> I have only started working with this but apparently something happende 
> when the core was updated from 4.1 to 4.2. The rte seems to work ok, but 
> the data is not saved as it should, Tags appear in the final news record.
> 
> Try it out here:
> 
> http://www.badasswebdeveloper.dk/nc/fe-news-adder.html - After the "show 
> preview" try to click the "dont save" button and the problem shows.
> 
> The latest news can be viewed here:
> 
> http://www.badasswebdeveloper.dk/index.php?id=313
> 
> Thanks for any input
> 
> /BB

I turned to jquery to solve the problem. I don't know if this is useful 
for anyone but here is my jquery:

  var decoded = 
decHTMLifEnc(jQuery(".tx-newsfeedit-pi1-preview-value-bodytext 
input").attr("value"));
  jQuery(".tx-newsfeedit-pi1-preview-value-bodytext 
input").attr("value", decoded);

function isEncHTML(str) {
   if(str.search(/&/g) != -1 || str.search(/</g) != -1 || 
str.search(/>/g) != -1)
     return true;
   else
     return false;
};

function decHTMLifEnc(str){
     if(isEncHTML(str))
       return str.replace(/&/g, '&').replace(/</g, 
'<').replace(/&gt;/g, '>');
     return str;
}

/BB


More information about the TYPO3-english mailing list