Firepup650
(Firepup Sixfifty)
December 5, 2024, 5:40am
1
I’m not sure what causes this, but it’s currently reproducible on Announcing: AI Web Artifacts
Normal:
Shrunk:
3 Likes
sam
(Sam Saffron)
December 5, 2024, 7:13am
2
hmmm this is indeed very confusing. @awesomerobot any ideas?
It looks like the excerpt includes unnecessary HTML. The <style>
tag overwrites the page style.
1 Like
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
def onebox
<<~HTML
<div>
<aside class="onebox allowlistedgeneric" data-onebox-src="#{url}">
<header class="source">
<span class="onebox-ai-llm-title">#{I18n.t("discourse_ai.share_ai.onebox_title", llm_name: llm_name)}</span>
<a href="#{url}" target="_blank" rel="nofollow ugc noopener" tabindex="-1">#{Discourse.base_uri}</a>
</header>
<article class="onebox-body">
<h3><a href="#{url}" rel="nofollow ugc noopener" tabindex="-1">#{title}</a></h3>
#{html_excerpt}
</article>
<div style="clear: both"></div>
</aside>
</div>
HTML
end
this is added inline:
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?
strip_links: true,
strip_details: true,
)
html << "<p><b>#{post.user.username}</b>: #{text}</p>"
if html.length > 1000
html << "<p>...</p>"
break
end
end
html << "<a href='#{url}'>#{I18n.t("discourse_ai.share_ai.read_more")}<a>"
html
end
def onebox
<<~HTML
<div>
<aside class="onebox allowlistedgeneric" data-onebox-src="#{url}">
<header class="source">
<span class="onebox-ai-llm-title">#{I18n.t("discourse_ai.share_ai.onebox_title", llm_name: llm_name)}</span>
<a href="#{url}" target="_blank" rel="nofollow ugc noopener" tabindex="-1">#{Discourse.base_uri}</a>
let’s see:
discourse:main
← discourse:fix-close-link
opened 08:02PM - 05 Dec 24 UTC
This link should be closed
`html << "<a href='#{url}'>#{I18n.t("discourse_ai.… share_ai.read_more")}<a>"`
3 Likes