Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

Commit

Permalink
stop treating , as ' or "
Browse files Browse the repository at this point in the history
  • Loading branch information
bgotink committed Apr 22, 2016
1 parent a785bd5 commit 6539ed1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/caml.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ function replaceVariables(yamlLines) {
function sanitize(yamlString) {
return yamlString.split('\n')
.map(function (line) {
var enclosedDottedMatch = line.trim().match(/[",'].*\..*[",']:\s/);
var enclosedDottedMatch = line.trim().match(/["'].*\..*["']:\s/);
var rawDottedMatch = line.trim().match(/.*\..*:\s/);

if (enclosedDottedMatch) {
var enclosedSubstituted = line.replace(enclosedDottedMatch[0],
enclosedDottedMatch[0]
.replace(/[",']/g, '') // Strip " or ' from the keys
.replace(/["']/g, '') // Strip " or ' from the keys
.replace(/\./g, DOT_SUBSTITUTE) // Replace . by DOT_SUBSTITUTE in "" keys
);

Expand Down

0 comments on commit 6539ed1

Please sign in to comment.