Open ShahkhalidShaikh opened 1 month ago
if (element.localName == 'h1' || element.localName == 'h2' || element.localName == 'h3' || element.localName == 'h4' || element.localName == 'h5' || element.localName == 'h6' || element.localName == 'span' || element.localName == 'strong' || element.localName == 'sup' || element.localName == 'figure' || element.localName == 'body' || element.localName == 'p') { return Text( element.text, maxLines: 2, overflow: TextOverflow.ellipsis, style: textStyle, );``
You need to use inline CSS to control the number of lines. However, it will not work if the HTML itself contains block-level elements because their layout is incompatible with line logic.
if (element.localName == 'h1' || element.localName == 'h2' || element.localName == 'h3' || element.localName == 'h4' || element.localName == 'h5' || element.localName == 'h6' || element.localName == 'span' || element.localName == 'strong' || element.localName == 'sup' || element.localName == 'figure' || element.localName == 'body' || element.localName == 'p') { return Text( element.text, maxLines: 2, overflow: TextOverflow.ellipsis, style: textStyle, );``