# 抜粋に一部のHTMLタグが含まれ、他は含まれないのはなぜですか？

**URL:** https://meta.discourse.org/t/why-do-excerpts-include-some-html-tags-but-not-others/224042
**Category:** Support
**Created:** [2022 年 4 月 12 日午後 1:27 UTC](https://meta.discourse.org/t/why-do-excerpts-include-some-html-tags-but-not-others/224042 "2022-04-12T13:27:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![md-misko](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/md-misko/32/126315_2.png) [@md-misko](https://meta.discourse.org/u/md-misko)
#### Post date: [2022 年 4 月 12 日午後 1:27 UTC](https://meta.discourse.org/t/why-do-excerpts-include-some-html-tags-but-not-others/224042/1 "2022-04-12T13:27:15Z")

</div>

コンポーネントがトピック抜粋内に一部のHTMLタグを保持する一方で、他のタグは保持しないことに気づきました。これは最初のサンプル投稿です。

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

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

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

```

これは次のようにレンダリングされます。

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/8/9/789309ea47d44ecd42a7535c6c67c57b797ff4a7.png)

`\u003cdetails\u003e` タグが保持されるのと同じように、`\u003ctable\u003e` および `\u003cpre\u003e` タグも保持することは可能でしょうか？

> **topic-excerpt code**
>
> ```html
> <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>
> 
> ```

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2022 年 4 月 12 日午後 1:59 UTC](https://meta.discourse.org/t/why-do-excerpts-include-some-html-tags-but-not-others/224042/2 "2022-04-12T13:59:30Z")

</div>

@md-misko様 - Discourseコアの抜粋ジェネレーターに依存する[topic-list-excerpts テーマコンポーネント](https://meta.discourse.org/t/topic-list-excerpts-theme-component/151520?u=david)のため、これを独自の#supportトピックに移動しました。なぜ`<details>`が含まれているのかの経緯は不明ですが、誰かが代わりに回答してくれるかもしれません。
