Index: /quintagroup.dropdownmenu/trunk/docs/HISTORY.txt
===================================================================
--- /quintagroup.dropdownmenu/trunk/docs/HISTORY.txt	(revision 3627)
+++ /quintagroup.dropdownmenu/trunk/docs/HISTORY.txt	(revision 3628)
@@ -9,4 +9,8 @@
 
 * Fixed empty class attributes [kroman0]
+
+* Fixed html validation of mobile layout [kroman0]
+
+* Cleanup templates [kroman0]
 
 1.2.11 - August 10,2012
Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections.pt
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections.pt	(revision 3627)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections.pt	(revision 3628)
@@ -1,16 +1,19 @@
 <tal:tabs tal:define="menu view/createMenu"
           tal:condition="menu"
-          i18n:domain="plone">
-    <p class="hiddenStructure" i18n:translate="heading_sections">Navigation</p>
-    <ul id="portal-globalnav" tal:attributes="class python:view.conf.mobile_menu and 'mobileMenuOn' or nothing">
-        <li tal:replace="structure menu">
-            DropDown Menu
-        </li>
-    </ul>
-    <select id="portal-globalnav-mobile"
-            tal:condition="view/conf/mobile_menu"
-            tal:content="structure view/createMenuMobile"
-            onchange="location = this.options[this.selectedIndex].value;">
-        <option value="" selected="selected">Menu</option>
-    </select>
-</tal:tabs>
+          i18n:domain="plone"
+    ><p class="hiddenStructure"
+        i18n:translate="heading_sections"
+        >Navigation</p
+    ><ul id="portal-globalnav"
+         tal:attributes="class python:view.conf.mobile_menu and 'mobileMenuOn' or nothing"
+        ><li tal:replace="structure menu"
+            >DropDown Menu</li
+        ></ul
+    ><select id="portal-globalnav-mobile"
+             tal:condition="view/conf/mobile_menu"
+             tal:content="structure view/createMenuMobile"
+             onchange="location = this.options[this.selectedIndex].value;"
+        ><option value="" selected="selected"
+            >Menu</option
+        ></select
+    ></tal:tabs>
Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections_mobile.pt
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections_mobile.pt	(revision 3627)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections_mobile.pt	(revision 3628)
@@ -2,24 +2,37 @@
                     children options/children | nothing;
                     plonefour view/is_plone_four"
-            i18n:domain="plone">
-
-<metal:main define-macro="sections_main">
-<tal:navitem repeat="node children">
-<tal:option tal:define="show_children   node/show_children;
-                        children        node/children;
-                        item_url        node/getURL;
-                        is_current      node/currentItem;">
-    <option tal:attributes="value python:item_url;
-                            title node/Description;"
-            tal:condition="not:is_current"
-            ><span tal:repeat="l python:range(level-2)">&nbsp;&nbsp;</span><span tal:condition="python:level>1">&minus;&nbsp;</span><span tal:content="node/Title">Selected Item Title</span></option>
-    <option tal:attributes="value python:item_url;
-                            title node/Description;"
-            selected="selected"
-            tal:condition="is_current"
-            ><span tal:repeat="l python:range(level-2)">&nbsp;&nbsp;</span><span tal:condition="python:level>1">&minus;&nbsp;</span><span tal:content="node/Title">Selected Item Title</span></option>
-    <option tal:condition="python: len(children) > 0 and show_children" tal:replace="structure python:view.mobile(children=children, level=level+1)">SubMenu</option>
-</tal:option>
-</tal:navitem>
-</metal:main>
-</tal:master>
+            i18n:domain="plone"
+    ><metal:main define-macro="sections_main"
+        ><tal:navitem repeat="node children"
+            ><tal:option tal:define="show_children   node/show_children;
+                                     children        node/children;
+                                     item_url        node/getURL;
+                                     is_current      node/currentItem;"
+                ><option tal:attributes="value python:item_url;
+                                         title node/Description;"
+                         tal:condition="not:is_current"
+                    ><tal:span tal:repeat="l python:range(level-2)"
+                        >&nbsp;&nbsp;</tal:span
+                    ><tal:span tal:condition="python:level>1"
+                        >&minus;&nbsp;</tal:span
+                    ><tal:span tal:content="node/Title"
+                        >Selected Item Title</tal:span
+                ></option
+            ><option tal:attributes="value python:item_url;
+                                     title node/Description;"
+                     selected="selected"
+                     tal:condition="is_current"
+                ><tal:span tal:repeat="l python:range(level-2)"
+                    >&nbsp;&nbsp;</tal:span
+                ><tal:span tal:condition="python:level>1"
+                    >&minus;&nbsp;</tal:span
+                ><tal:span tal:content="node/Title"
+                    >Selected Item Title</tal:span
+                ></option
+            ><option tal:condition="python: len(children) > 0 and show_children"
+                     tal:replace="structure python:view.mobile(children=children, level=level+1)"
+                >SubMenu</option
+            ></tal:option
+        ></tal:navitem
+    ></metal:main
+></tal:master>
Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections_recurse.pt
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections_recurse.pt	(revision 3627)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/templates/sections_recurse.pt	(revision 3628)
@@ -2,43 +2,38 @@
                     children options/children | nothing;
                     plonefour view/is_plone_four"
-            i18n:domain="plone">
-
-<metal:main define-macro="sections_main">
-<tal:navitem repeat="node children">
-<li tal:define="is_current      node/currentItem;
-                is_in_path      node/currentParent;
-                li_curr_class   python:is_current and 'selected' or '';
-                li_extr_class   python:(is_in_path and not is_current) and 'selected' or '';
-                li_extr_class   python:(not (is_in_path or is_current)) and li_extr_class + 'plain' or li_extr_class;
-                li_class string:${li_curr_class}${li_extr_class};
-                li_class python:li_class or nothing"
-    tal:attributes="class li_class">
-
-    <tal:level define="show_children node/show_children;
-                       children node/children;
-                       show_icons view/conf/show_icons;
-                       item_icon node/item_icon;
-                       item_type node/normalized_portal_type | nothing;
-                       a_class python:children and 'hasChildrens' or nothing">
-
-    <a tal:attributes="href node/getURL;
-                       title node/Description|nothing;
-                       class a_class">
-        <img tal:condition="python: show_icons and not plonefour"
-             tal:replace="structure item_icon/html_tag | nothing" />
-        <span tal:content="node/Title"
-              tal:attributes="class python: plonefour and show_icons and item_type and 'contenttype-'+ item_type or nothing">Selected Item Title</span>
-    </a>
-
-    <ul tal:attributes="class python:'globalSectionsLevel'+str(level)"
-        tal:condition="python: len(children) > 0 and show_children">
-        <li tal:replace="structure python:view.recurse(children=children, level=level+1)">
-            SubMenu
-        </li>
-    </ul>
-    </tal:level>
-
-</li>
-</tal:navitem>
-</metal:main>
-</tal:master>
+            i18n:domain="plone"
+    ><metal:main define-macro="sections_main"
+        ><tal:navitem repeat="node children"
+            ><li tal:define="is_current      node/currentItem;
+                             is_in_path      node/currentParent;
+                             li_curr_class   python:is_current and 'selected' or '';
+                             li_extr_class   python:(is_in_path and not is_current) and 'selected' or '';
+                             li_extr_class   python:(not (is_in_path or is_current)) and li_extr_class + 'plain' or li_extr_class;
+                             li_class string:${li_curr_class}${li_extr_class};
+                             li_class python:li_class or nothing"
+                 tal:attributes="class li_class"
+                ><tal:level define="show_children node/show_children;
+                            children node/children;
+                            show_icons view/conf/show_icons;
+                            item_icon node/item_icon;
+                            item_type node/normalized_portal_type | nothing;
+                            a_class python:children and 'hasChildrens' or nothing"
+                    ><a tal:attributes="href node/getURL;
+                                        title node/Description|nothing;
+                                        class a_class"
+                        ><img tal:condition="python: show_icons and not plonefour"
+                              tal:replace="structure item_icon/html_tag | nothing"
+                        /><span tal:content="node/Title"
+                                tal:attributes="class python: plonefour and show_icons and item_type and 'contenttype-'+ item_type or nothing"
+                            >Selected Item Title</span
+                    ></a
+                ><ul tal:attributes="class python:'globalSectionsLevel'+str(level)"
+                       tal:condition="python: len(children) > 0 and show_children"
+                    ><li tal:replace="structure python:view.recurse(children=children, level=level+1)"
+                        >SubMenu</li
+                    ></ul
+                ></tal:level
+            ></li
+        ></tal:navitem
+    ></metal:main
+></tal:master>
Index: /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py
===================================================================
--- /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py	(revision 3627)
+++ /quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/viewlets.py	(revision 3628)
@@ -258,10 +258,10 @@
     def createMenuMobile(self):
         html = self.mobile(children=self.portal_tabs(), level=1)
-        return xhtmlslimmer.compress(html).strip('\n')
+        return xhtmlslimmer.compress(html).strip(' \n')
 
     @dropdowncache
     def createMenu(self):
         html = self.recurse(children=self.portal_tabs(), level=1)
-        return xhtmlslimmer.compress(html).strip('\n')
+        return xhtmlslimmer.compress(html).strip(' \n')
 
     @memoize
