xuijs / xui

A tiny javascript framework for mobile web apps.

Home Page:http://xuijs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.HTML() method does not support HTML that contains % signs or periods

jmonroe opened this issue · comments

Example....

var markup = "<li id='help' style='width: 33%;'> help </li>"
x$(#testing).html('bottom', markup)

This results in the width property not being applied due to the percent sign.

var markup = "<li id='help' style='width: 33.3333%;'> help </li>"
x$(#testing).html('bottom', markup)

This also does not work even after fixing the % issue because the regex split does not accommodate periods either.

The problem can be fixed by modifying line 195 of DOM.JS

It is currently
attrList = result[2].split(/([A-Z-]\s=\s_['|"][A-Z0-9:;#\s]['|"])/i);
I corrected the issue by changing it to
attrList = result[2].split(/([A-Z-]
\s_=\s_['|"][A-Z0-9:;#%.\s]_['|"])/i);