Posted
almost 14 years
ago
by
l
lol
|
Posted
almost 14 years
ago
by
Plefand
|
Posted
almost 14 years
ago
by
Rafał Kukawski
@Dj: thanks for your feedback. Changed the function according to your suggestions. You can see the changes on github.
|
Posted
almost 14 years
ago
by
Dj
Note that the regex for double encode is not correct because it does not inglude html entities for uppercase characters, like Ñ
replace [a-z][\da-z] with [a-zA-Z][\da-z]
|
Posted
almost 14 years
ago
by
Dj
Instead of replace '+' with '%20', replace it with an space directly, then is not redundant and decodeURIComponent() will has less characters to proccess
|
Posted
about 14 years
ago
by
Brett Zamir
Yeah. Date.parse() is now apparently treating "11" as 1911. And since Date.parse() might vary across browsers, we should I think be using our own implementation anyways rather than allowing for different behavior by browser. Thoughts?
|
Posted
about 14 years
ago
by
Jason
Try this in Firefox 5:
console.log(strtotime("06/28/2011"));
console.log(strtotime("06/28/11"));
You get
1309237200
-1846522800
It isn't properly detecting 2 digit years.
|
Posted
about 14 years
ago
by
?
'
|
Posted
about 14 years
ago
by
Dj
Why not use first regex instead the second one? (without [^>\r\n]?)
return (str + '').replace(/(\r\n|\n\r|\r|\n)/g, breakTag + '$1');
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
|
Posted
about 14 years
ago
by
Dj
Here one optimized version.
Using recursion calling self.htmlentities() will cause to load the table again and check source values, which does not make sense because you are using the same table.
So instead of recursion, use a simple loop working in
|