1
0
mirror of https://github.com/sasjs/lint.git synced 2026-01-05 11:40:06 +00:00

fix(parseMacros): avoid statement break on html encoded semi colon

This commit is contained in:
Saad Jutt
2021-05-21 20:05:53 +05:00
parent 5701064c07
commit c9fa366130
3 changed files with 49 additions and 0 deletions

View File

@@ -38,6 +38,19 @@ export const parseMacros = (text: string, config?: LintConfig): Macro[] => {
const statements: string[] = trimmedLine.split(';')
if (isReadingMacroDefinition) {
statements.forEach((statement, statementIndex) => {
if (/&[^\s]{1,5}$/.test(statement)) {
const next = statements[statementIndex]
const updatedStatement = `${statement};${
statements[statementIndex + 1]
}`
statements.splice(statementIndex, 1, updatedStatement)
statements.splice(statementIndex + 1, 1)
}
})
}
statements.forEach((statement, statementIndex) => {
const { statement: trimmedStatement, commentStarted } = trimComments(
statement,