You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ZMarkupParser serves as a converter from HTML strings to NSAttributedString. If you can use the styles set by NSAttributedString.Key(attributes), there is a chance to implement them in ZMarkupParser, and vice versa. Unfortunately, I couldn't find a perfect way to adapt HTML table styles in ZMarkupParser after searching through the documentation.
Using NSAttributedString.DocumentType.HTML renders HTML using the original NSAttributedString approach. I speculate that it is rendered through WebKit and uses NSTextBlock, which is not available in the iOS Public API. Therefore, I'm unable to utilize it.
Currently, the only solution is to fallback to using NSAttributedString.DocumentType.HTML or create a new project to explore TextKit-related content (more low-level) or simply use ASCII tables as a substitute for tables.
ZMarkupParser 只作為一個 HTML String to NSAttributedString 的轉換器,如果能使用NSAttributedString+ NSAttributedString.Key(attributes) 設定的樣式,都有機會在 ZMarkupParser 實現,反之亦然;很遺憾的我翻片了文件找不到能完美適配 HTML Table 樣式的方式。
使用 NSAttributedString.DocumentType.HTML 就是原始的 NSAttributedString 渲染 HTML 方式,我猜測是透過 WebKit 渲染,他所使用的物件是 NSTextBlock,這不存在在 iOS Public API 中,因此我無法調用實踐。
I'm currently exploring markdown rendering (to implement a ChatGPT like app) on iOS and find it's hard to implement a basic table in text view.
However I found it's implemented in an App called 豆包(a ByteDance app, the company who made TikTok) in China mainland & CiCi outside China mainland.
豆包:https://www.doubao.com/
Cici:https://www.ciciai.com/
As you mentioned in your article https://medium.com/zrealm-ios-dev/%E6%89%8B%E5%B7%A5%E6%89%93%E9%80%A0-html-%E8%A7%A3%E6%9E%90%E5%99%A8%E7%9A%84%E9%82%A3%E4%BA%9B%E4%BA%8B-2724f02f6e7
Would you like to tell about your thought about how they achieved it?
I've also explored ChatGPT's app. They haven't implement table rendering in their iOS App.
The text was updated successfully, but these errors were encountered: