mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-05-13 15:09:12 +00:00
feat: enhance header rendering and description extraction
- Optimized header component to directly set HTML content for improved rendering performance and security. - Modified description extraction method to retrieve HTML content, enhancing the accuracy and richness of displayed information. - Added word-break property to site intro for better handling of long words and URLs.
This commit is contained in:
@@ -115,15 +115,14 @@ const staticProxy = getEnv(import.meta.env, Astro, 'STATIC_PROXY') ?? '/static/'
|
||||
|
||||
{
|
||||
channel?.description && channel?.description.length > 0 && (
|
||||
<div class="text-box" id="site-intro">
|
||||
{channel?.description}
|
||||
</div>
|
||||
<div class="text-box" id="site-intro" set:html={channel?.description} />
|
||||
)
|
||||
}
|
||||
|
||||
<style>
|
||||
#site-intro {
|
||||
color: var(--secondary-color);
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.social-icon {
|
||||
|
||||
@@ -149,7 +149,7 @@ export async function getChannelInfo(Astro, { before = '', after = '', q = '', t
|
||||
const channelInfo = {
|
||||
posts,
|
||||
title: $('.tgme_channel_info_header_title')?.text(),
|
||||
description: $('.tgme_channel_info_description')?.text(),
|
||||
description: $('.tgme_channel_info_description')?.html(),
|
||||
avatar: $('.tgme_page_photo_image img')?.attr('src'),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user