Closed clochix closed 12 years ago
I wanted to use innerHTML
innerHTML
duck = run <a href="http://duck.net">baby</a>
But you use = to split the string, so everything after href is lost.
=
Here's a quick fix proposal:
git diff --no-prefix
diff --git l10n.js l10n.js index 3be588a..2924727 100644 --- l10n.js +++ l10n.js @@ -127,7 +127,7 @@ document.webL10n = (function(window, document, undefined) { var reComment = /^\s*#|^\s*$/; var reSection = /^\s*\[(.*)\]\s*$/; var reImport = /^\s*@import\s+url\((.*)\)\s*$/i; - var reSplit = /\s*=\s*/; // TODO: support backslashes to escape EOLs + var reSplit = /^([^=\s]*)\s*=\s*(.+)$/; // TODO: support backslashes to escape EOLs // parse the *.properties file into an associative array function parseRawLines(rawText, extendedSyntax) { @@ -162,9 +162,9 @@ document.webL10n = (function(window, document, undefined) { } // key-value pair - var tmp = line.split(reSplit); - if (tmp.length > 1) - dictionary[tmp[0]] = evalString(tmp[1]); + var tmp = line.match(reSplit); + if (tmp.length === 3) + dictionary[tmp[1]] = evalString(tmp[2]); } }
agreed, thanks! WIP.
solved with the latest commit, thanks again
I wanted to use
innerHTML
But you use
=
to split the string, so everything after href is lost.Here's a quick fix proposal:
git diff --no-prefix