AE expression to link source text and font size
I am very new at writing/combining AE expressions and often spend a lot of time on these forums to find solutions. Usually I find everything I need relatively quickly, but this for this new MOGRT I am creating I am having difficulties getting everything to work properly.
Basically, I have two text layers and I want the main text layer to be the parent that the secondary text layer references for the source text values (such as any characters/numbers types) and for font size. The first part is easily done, the issue comes when I try to link the secondary text layer's font size to the main text layer's. When trying to apply the font size to the layer it replaces the source text value, but does not replicate the text's paragraph breaks and so the text just runs off screen. I've spent hours trying to figure this out and have used many other forum threads to get to this point so any and all help is appeciated.
Current Expression:
txt = thisComp.layer("MainText")
sourceText = thisComp.layer("MainText").text.sourceText;
fontSize = thisComp.layer("Extra Controls").effect("Font Size")("Slider");
createStyle().setFontSize(fontSize).setText(txt)
The attached image shows the text runoff in the green highlighted area. The word "priorites" should have dropped to the second line following the main text.

