Skip to content

Commit

Permalink
ooops
Browse files Browse the repository at this point in the history
  • Loading branch information
denofevil committed Apr 9, 2017
1 parent 7f026e0 commit 2bcce9b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@ function convertSnippet(snippet, context) {
vars[name] = value;
return "$" + name + "$";
};
body = body.replace(/\$([_a-zA-Z0-9\-]+)/, replacement);
let unprocessedBody;
do {
unprocessedBody = body;
body = body.replace(/\${([_a-zA-Z0-9\-]+(?:\s*:\s*([_a-zA-Z][_a-zA-Z0-9]*))?)}/, replacement);
} while (unprocessedBody !== body);
body = body.replace(/\$([_a-zA-Z0-9\-]+)/g, replacement);
body = body.replace(/\${([_a-zA-Z0-9\-]+(?:\s*:\s*([_a-zA-Z][_a-zA-Z0-9]*))?)}/g, replacement);

let templateText = `
<template name="${xmlEscape(snippet.prefix)}" value="${xmlEscape(body)}" description="${xmlEscape(snippet.description)}" toReformat="true" toShortenFQNames="true">`;
Expand Down

0 comments on commit 2bcce9b

Please sign in to comment.