Fixes #12243. Merged style definitions.

The styleText variable does not always have a trailing ';' as it may come like this directly when pasting. Added a sanity check/fix to ensure it ends in ';' so that adding now definitions keeps a valid syntax.
Ensure style consistency by joining array items instead of string concatenation.
Changelog entry.
Merge branch 't/12243'