Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Bug fix: when clicking the HTML button in the toolbar, IMG tags are n…
Browse files Browse the repository at this point in the history
…ot XHTML compliant
  • Loading branch information
olivier authored and cheeaun committed Oct 11, 2009
1 parent 58514e2 commit 9cca63b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/MooEditable/MooEditable.js
Expand Up @@ -582,6 +582,12 @@ var MooEditable = new Class({
// source = source.replace(/(<(?:img|input)[^/>]*)>/g, '$1 />');
// }


//make img tags xhtml compatible <img>,<img></img> -> <img/>
if (this.options.xhtml){
source = source.replace(/<img([^>]+)(\s*[^\/])>(<\/img>)*/gi, '<img $1$2/>');
}

//remove double <p> tags and empty <p> tags
source = source.replace(/<p>(?:\s*)<p>/g, '<p>');
source = source.replace(/<\/p>\s*<\/p>/g, '</p>');
Expand Down

0 comments on commit 9cca63b

Please sign in to comment.