Skip to content

Commit

Permalink
fix(parser): update the regex used to find special variables
Browse files Browse the repository at this point in the history
  • Loading branch information
nishantwrp authored Aug 24, 2021
1 parent 720eea2 commit cb3d677
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class Parser {

const wrapInQuotes = (definitionsBlock: string, properties: string[]) => {
for (const prop of properties) {
const pattern = new RegExp(`^ *${prop}:.*`, "gm");
const pattern = new RegExp(`^[^\S\n]*${prop}[^\S\n]*:.*`, "gm");
const matches = definitionsBlock.match(pattern);
if (!matches) {
continue;
Expand Down

0 comments on commit cb3d677

Please sign in to comment.