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 17, 2020
1 parent e3f0868 commit c0ccb4c
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 c0ccb4c

Please sign in to comment.