From 9cca63bbd06ba47945b212d6db4d56a2741999d7 Mon Sep 17 00:00:00 2001 From: olivier Date: Fri, 2 Oct 2009 04:13:45 +0800 Subject: [PATCH] Bug fix: when clicking the HTML button in the toolbar, IMG tags are not XHTML compliant --- Source/MooEditable/MooEditable.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/MooEditable/MooEditable.js b/Source/MooEditable/MooEditable.js index c4a10ef..b26dd2c 100644 --- a/Source/MooEditable/MooEditable.js +++ b/Source/MooEditable/MooEditable.js @@ -582,6 +582,12 @@ var MooEditable = new Class({ // source = source.replace(/(<(?:img|input)[^/>]*)>/g, '$1 />'); // } + + //make img tags xhtml compatible , -> + if (this.options.xhtml){ + source = source.replace(/]+)(\s*[^\/])>(<\/img>)*/gi, ''); + } + //remove double

tags and empty

tags source = source.replace(/

(?:\s*)

/g, '

'); source = source.replace(/<\/p>\s*<\/p>/g, '

');