# Page width shrinks on certain topic

**URL:** https://meta.discourse.org/t/page-width-shrinks-on-certain-topic/340569
**Category:** Bug
**Created:** [December 5, 2024, 5:40am UTC](https://meta.discourse.org/t/page-width-shrinks-on-certain-topic/340569 "2024-12-05T05:40:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [December 5, 2024, 5:40am UTC](https://meta.discourse.org/t/page-width-shrinks-on-certain-topic/340569/1 "2024-12-05T05:40:02Z")

</div>

I’m not sure what causes this, but it’s currently reproducible on [Announcing: AI Web Artifacts](https://meta.discourse.org/t/announcing-ai-web-artifacts/339979)

Normal:

 ![The image shows a screenshot of the Discourse forum, displaying various topics and recent activity on the site. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/4/b/0/4b0d6705c703d20c2c2fad4f467f45fcf8d28fed.png)

Shrunk:

 ![The image is a screenshot of the Discourse forum, showing various topics and recent activity on the site. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/d/c/2/dc2899aa04789cf4ddeb86555e7a4ea57fe46362.png)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 5, 2024, 7:13am UTC](https://meta.discourse.org/t/page-width-shrinks-on-certain-topic/340569/2 "2024-12-05T07:13:49Z")

</div>

hmmm this is indeed very confusing. @awesomerobot any ideas?

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [December 5, 2024, 1:45pm UTC](https://meta.discourse.org/t/page-width-shrinks-on-certain-topic/340569/4 "2024-12-05T13:45:26Z")

</div>

It looks like the excerpt includes unnecessary HTML. The `<style>` tag overwrites the page style.

 ![A screenshot of a forum page with a discussion thread about creating a slot machine game using HTML, CSS, and JavaScript. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/b/4/1/b41c45ab38242a457cf217eb6fa3a1a8a8a92d4e.png)

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [December 5, 2024, 7:48pm UTC](https://meta.discourse.org/t/page-width-shrinks-on-certain-topic/340569/5 "2024-12-05T19:48:22Z")

</div>

Definitely some leaky CSS somewhere… `display: flex` gets added to the body… and it looks like there’s some HTML from the share making its way into there?

Seems to come from

> <https://github.com/discourse/discourse-ai/blob/117c06220e0678e5e9cb3ba56205159f63a91f34/app/models/shared_ai_conversation.rb#L110-L126>

this is added inline:

```css
    body {
      font-family: Arial, sans-serif;
      display: flex;
      justify-content: center;
      align-...</p><p>...</p><a href='/discourse-ai/ai-bot/shared-ai-conversations/xrWufuvPZJFxlUvYW2cHSQ'>Read full transcript<a>
</article>
<div style="clear: both"></div>
</aside>
</div>

```

issue with `html_excerpt`?

unclosed link tossing a wrench into the works?

> <https://github.com/discourse/discourse-ai/blob/117c06220e0678e5e9cb3ba56205159f63a91f34/app/models/shared_ai_conversation.rb#L106>

let’s see:

[https://github.com/discourse/discourse-ai/pull/1007](https://github.com/discourse/discourse-ai/pull/1007)

---

<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: [December 6, 2024, 10:29am UTC](https://meta.discourse.org/t/page-width-shrinks-on-certain-topic/340569/6 "2024-12-06T10:29:27Z")

</div>


