Issue Bug Closed

#99503Inline script concatenation requires scripts to have trailing ";"

Jonas Eberle 01/10/23, 10:50 updated 07/09/24, 12:46

Description

concatenateJs produces invalid JavaScript if scripts do not end with ‘;’.

In JavaScript ‘;’ line endings are optional, but when concatenating scripts a ‘;’ (or a line feed) needs to be added.

Minimum reproducible example:

(TypoScript settings)

config.concatenateJs = 1  
page.jsInline {
  script1 = TEXT
  script1.value = alert(1)
  script2 = TEXT
  script2.value = alert(2)
}

This results in

alert(1)alert(2)

(This applies to concatenated files in any of the PAGE.includeJS functions and friends, too)

Reviews 6