Accept single quotes for attributes in TW files

print-window-tiddler
Jermolene 2014-05-01 17:58:49 +01:00
rodzic f5848c395a
commit bced7124e4
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -51,13 +51,13 @@ var parseTiddlerDiv = function(text /* [,fields] */) {
// Extract the text
result.text = text.substring(match.index + match[0].length,endMatch.index);
// Process the attributes
var attrRegExp = /\s*([^=\s]+)\s*=\s*"([^"]*)"/gi,
var attrRegExp = /\s*([^=\s]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/gi,
attrMatch;
do {
attrMatch = attrRegExp.exec(match[1]);
if(attrMatch) {
var name = attrMatch[1];
var value = attrMatch[2];
var value = attrMatch[2] || attrMatch[3];
result[name] = value;
}
} while(attrMatch);