Why do excerpts include some HTML tags, but not others?

I’ve noticed that the component preserves some html tags inside the topic excerpt, but not others. This is a sample first post

|Item|QTY|
|-|-:|
|Apples|25|
|Oranges|7|
|Pineapples|12|

[details="Summary"]
This text will be hidden
[/details]

    Item        QTY
    ---------------
    Apples       25
    Oranges       7
    Pineapples   12

which is rendered like this:

Is it possible to also preserve <table> and <pre> tags the same way <details> tag is preserved in the generated

topic-excerpt code
<a href="/t/preview-topic/1375" class="topic-excerpt">
    Item
QTY




Apples
25


Oranges
7


Pineapples
12



<details><summary>Summary</summary>This text will be hidden</details>
Item        QTY
---------------
Apples       25
Oranges       7
Pineapples   12
  </a>
2 Likes

Hi @md-misko - I’ve moved this into its own support topic since the topic-list-excerpts theme component relies on Discourse core’s excerpt generator. I’m not sure of the history behind why <details> is included, but maybe someone else will jump in.

3 Likes