mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-13 18:46:56 -04:00
improve parseIni
This commit is contained in:
parent
c85dd9b437
commit
46173ec423
1 changed files with 1 additions and 0 deletions
|
@ -19,6 +19,7 @@ var parseIni = function (input) {
|
||||||
var result = {},
|
var result = {},
|
||||||
lines = input.split('\n');
|
lines = input.split('\n');
|
||||||
_.each (lines, function(line) {
|
_.each (lines, function(line) {
|
||||||
|
line = line.trim();
|
||||||
if ((line.length > 0) && (line[0] != ';') && (line[0] != '[')) {
|
if ((line.length > 0) && (line[0] != ';') && (line[0] != '[')) {
|
||||||
line = line.split('=', 2);
|
line = line.split('=', 2);
|
||||||
if (line.length == 2) result[line[0].trim()]=line[1].trim();
|
if (line.length == 2) result[line[0].trim()]=line[1].trim();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue