有没有办法在不使用 replace 的情况下将下面的文本字符串转换为 html 字符串?
文本字符串
{"a":"\u003cul class=\"ylist ylist-bordered search-results\"\u003e\n\t\t\t\n\t\t\t\t\t\u003cli class=\"add -search-result\"\u003e\n\t\t\t\t\t\t\t\u003cdiv class=\"search-result yla biz-listing-large www-yla-unit-color-555555-ffefcb \" data-key=\"ad_business\"\u003e\n\t\t\t\u003cspan class=\"yla-tip\"\u003eYelp Ad\u003c/span\u003e\n\n\n\t\ t\u003cdiv class=\"media-block media-block-large clearfix main-attributes\"\u003e\n\t\t\t\u003cdiv"}
HTML 字符串
{"a": "<ul class=\"ylist ylist-bordered search-results\">\n\t\t\t\n\t\t\t\t\t<li class=\"add-search-result\">\n\t\t\t\t\t\t\t<div class=\"search-result yla biz-listing-large www-yla-unit-color-555555-ffefcb\" data-key=\"ad_business\">\n\t\t\t<span class=\"yla-tip\">Yelp Ad</span>\n\n\n\t\t<div class=\"media-block media-block-large clearfix main-attributes\">\n\t\t\t<div class=\"media-avatar\">\n\t\t\t\t\t\t\n\n\n\t<div class=\"photo-box biz-photo-box pb-90s\">\n\t\t\t<a href=\"/adredir?position=0&redirect_url=http%3A%2F%2Fwww.yelp.com%2Fbiz%2Fez-pawn-corp-new-york-3&"}
我尝试了下面的代码,但它没有按预期工作(excel-vba)
Dim html As Object
Set html = CreateObject("htmlfile")
html.body.innerText = strDiv
Debug.Print html.body.innerHTML
如果我将文本字符串复制到http://jsonlint.com/
以验证字符串,它将返回转换后的 html 字符串。