How to keep line breaks on excerpts?

Hi! I’m using this theme component for a poetry community and I would like that the excerpts do not escape new lines (so verses are still in separated lines, even in the excerpt).

I assume I must create some kind of simple (?) plugin to implement this functionality. I have been checking the Discourse code but I didn’t find where should I look in order to change that.

I would be really grateful if you could give some hint :slight_smile: .

Thanks!

1 Like

This can be done using this CSS:

.topic-list .topic-excerpt {
    white-space: pre-line;
}

This was originally described here: How can I keep post views on lists - #5 by Don


edit:
:information_source: since being able to keep line breaks in excerpts was asked multiple times, I’ve added this as a tip/trick on the official topic.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.