You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes there is a requirement to toggle the rest of given html text using Javascript(show more/show less functionality). In order to implement this without duplicating truncated html I need the rest of it.
I tried to get the rest of html as following:
But when there are extra consecutive whitespace in the given html, above code won't produce correct output. This is because in TruncateHtml::HtmlString#html_tokens method consecutive whitespace are being reduced to single whitespace.
Therefore I propose to create new helper "slice_html" that returns both truncated html and
the rest as following:
Sometimes there is a requirement to toggle the rest of given html text using Javascript(show more/show less functionality). In order to implement this without duplicating truncated html I need the rest of it.
I tried to get the rest of html as following:
But when there are extra consecutive whitespace in the given html, above code won't produce correct output. This is because in TruncateHtml::HtmlString#html_tokens method consecutive whitespace are being reduced to single whitespace.
Therefore I propose to create new helper "slice_html" that returns both truncated html and
the rest as following:
The text was updated successfully, but these errors were encountered: