LoginSignup
0
0

More than 5 years have passed since last update.

aura:unescapedHtmlタグの使い方

Posted at

aura:unescapedHtmlタグはドキュメントの37ページ目にさらっとだけ紹介されています。実際試してみましょう。

<p>aura:unescapedHtml sample</p>
<dl>
    <aura:iteration items="&amp;amp;,&amp;lt;,&amp;gt;,&amp;quot;" var="escaped">
        <dt>{!escaped}</dt>
        <dd><aura:unescapedHtml value="{!escaped}" /></dd>
    </aura:iteration>
</dl>

こんな感じに出力されます。

aura:unescapedHtml sample

&amp;
&
&lt;
<
&gt;
>
&quot;
"

ただし、コンポーネント内でscriptタグをunescapeして出力しても、<script>から</script>の間が完全に消去されてしまいました。「サポートされるHTMLタグ」の除外タグには含まれていないんですけどね…。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0