Expandable text

Hi,
I used the code below to show short text that can expand on click.
When I did it, I lost the original text formatting (the font size is not the same).
What do you think I should do to resolve this issue?
Thanks,

This is the code I used:

let fullText;
let shortText;
$w.onReady( function () {
const shortTextLength = 400;
fullText = $w(“#text1”).text;
shortText = fullText.substr(0, shortTextLength) + “…”;
$w(“#text1”).text = shortText;
});
export function button1_click_1(event) {
if ($w(“#text1”).text === shortText) {
$w(“#text1”).text = fullText;
$w(“#button1”).label = “Show less”;
} else {
$w(“#text1”).text = shortText;
$w(“#button1”).label = “Read more…”;
}}

See the Wix Code Tutorial: Creating a Show-More Link . Good luck

Hi @yisrael-wix ,
I don’t see there anything in regard to how to control text formatting.
As I described above, my code works well, the text gets expanded as expected and everything is fine, but the text formatting (i.e. font size) is different than defined in the editor.
My question is how should I keep the text formatting when I use this code.
Thanks,
J.D.