The html used by the SimpleHtml has many limits. If you get the whole html, it means the widget reject to render it.
You should check the
Well-formed HTML in the
https://wowwiki-archive.fandom.com/w...ECT_SimpleHTML. Also concat string directly is a real pain.
Create custom UI is a big topic to be discussed here. You may discuss it in the WoWUIDev@discord.
And for the code to create such a frame, if you don't mind using other libs:
Lua Code:
Scorpio "SimpleHtmlTest" "" -- A Module based on my Scorpio Lib
-- Create a dialog to contains the viewer
Browser = Dialog("SimpleHtmlTestBrowser")
-- Create the html view from a template class based on the SimpleHtml
viewer = HtmlViewer ("Viewer", Browser)
-- Handle the link click
function viewer:OnHyperlinkClick(path)
if path then
-- Click the link and send to the chat box for copy
ChatEdit_ActivateChat(ChatFrame1EditBox)
ChatFrame1EditBox:SetText(path)
ChatFrame1EditBox:HighlightText(0, #path)
end
end
-- The style of those ui, just like xml with properties.
Style[Browser] = {
Header = { Text = "Table Viewer" },
Size = Size(800, 600),
clampedToScreen = true,
minResize = Size(600, 400),
Viewer = {
location = { Anchor("TOPLEFT", 24, -32), Anchor("BOTTOMRIGHT", -48, 48) },
},
}
-- A template string used to generate the target string with data
-- @xxx is the directives for lua codes, so here `name` and `target`
-- are the special variables to generate the final string
TEMPLATE_TABLE = System.Text.TemplateString[[
<html>
<body>
<h1>@name</h1>
<br/>
@for k, v in pairs(target) do
<p><a href="@k">@k</a></p>
@end
</body>
</html>
]]
-- A test
viewer:SetText(TEMPLATE_TABLE{
name = "C_AuctionHouse",
target = C_AuctionHouse,
})
It'd could be more longer to create this without a lib.
So this is an ADs
The Scorpio is a power addon dev platform, you can find my post at
https://www.wowinterface.com/forums/...splay.php?f=41.
I don't really like blz's mixin system, but you still can find me in the discord.