我正在尝试在HTML浏览器中显示以下字符串,但是当浏览器在字符串中遇到诸如“”之类的自定义标签时,它会跳过该字符串。
我尝试了encodeURIComponent(),后来又尝试在我的HTML模板中对URIComponent进行解码,但是没有用。
我什至试图通过创建如下所示的PIPE来清理HTML,但没有运气。
transform(v: string): SafeHtml {
return this._sanitizer.bypassSecurityTrustHtml(v);
}
以某种方式,浏览器正在像字符串中那样跳过元素。
以下是字符串
“The endpoint is browser-based, rather than RESTful. Therefore it could
result in the following different scenarios,↵1. SUCCESS
(response_type=code)↵> redirect_uri?code=<authorization-code>&scope=
<resource-owner-approved-scopes>[&state=<state-provided-by-the-client>]."