Skip to content

Commit

Permalink
Fix detection of built-in commands (#121)
Browse files Browse the repository at this point in the history
Allow variable names to start with a built-in command
  • Loading branch information
brummelte authored and jjhbw committed May 12, 2020
1 parent 336a66b commit 5753a43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/processTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,9 @@ const builtInCommands = [
'HTML',
];
const notBuiltIns = (cmd: string) =>
!builtInCommands.some(word => new RegExp(`^${word}`).test(cmd.toUpperCase()));
!builtInCommands.some(word =>
new RegExp(`^${word}\\b`).test(cmd.toUpperCase())
);

const getCommand = (ctx: Context): string => {
let { cmd } = ctx;
Expand Down

0 comments on commit 5753a43

Please sign in to comment.