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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user