NuPlay / RichText

Easily show RichText(html) in SwiftUI
MIT License
209 stars 36 forks source link

When my html string contains an image, RichText renders at an incorrect height because the image hasn't loaded yet #38

Open panghujiajia opened 1 year ago

NuPlay commented 1 year ago

Doesn't the frame change after the image loads?

panghujiajia commented 1 year ago

Doesn't the frame change after the image loads?

yes,there is my html

<div class="markdown_body"><p>如题,之前在工作之余,个人独立开发了一款文字修仙页游《匿名修仙》。</p>
<p>经过在这家公司 1 年多的时间,我时不时就提起我的修仙之路,最近终于给老板画上了大饼,我的观点:很多白领上班无聊需要一些网页来摸鱼,阐述了这个市场的用户群体,在我的七嘴八舌下,老板给了我一个机会,让我全职做一段时间,上线一版,看看效果,如果反响不错,公司将分配人员一起参与,由我全权主导去做!</p>
<p>目前还是我一个人在做,所以有很多不合理的地方,毕竟个人的精力有限,目前会持续更新和改进!下面是公测链接,一起来摸鱼修仙吧!!</p>
<p>游戏关键字:挂机、回合制、摸鱼、修仙、pk 、社交等。</p>
<p>游玩地址: <a href="https://www.nimingxx.com/register" rel="nofollow">https://www.nimingxx.com/register</a></p>
<p>注册验证码多试几次,跟浏览器大小有关,有时候不好使。</p>
<p>顺便评论区抽取 5 位幸运玩家送 cdk 兑换码,抽取方式为 js 的随机数,每个 id 只认第一条评论,0 至最大评论楼层。</p>
<p>这里贴上几张图:</p>
<p><img alt="1" class="embedded_image" loading="lazy" referrerpolicy="no-referrer" rel="noreferrer" src="https://campone.blob.core.windows.net/game/3431689558616_.pic.jpg
">
<img alt="2" class="embedded_image" loading="lazy" referrerpolicy="no-referrer" rel="noreferrer" src="
https://campone.blob.core.windows.net/game/3441689558621_.pic.jpg
">
<img alt="3" class="embedded_image" loading="lazy" referrerpolicy="no-referrer" rel="noreferrer" src="
https://campone.blob.core.windows.net/game/3451689558625_.pic.jpg
"></p>
</div>
NuPlay commented 12 months ago

Thank you for bringing this issue to our attention. I've looked into the problem and identified the root cause.

I'm currently in the process of restructuring the library, and I'll make sure to address this issue as part of that work.

I apologize for not being as active in maintaining the library recently; it's been a busy time for me. However, I'm committed to resolving this as quickly as possible.

panghujiajia commented 12 months ago

thanks!

axiel7 commented 5 months ago

I have a similar problem where RichText ignores the width value of the img. Maybe this is related or should I open a separate issue?