7
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

riot.jsで、テンプレートにタグを含む文字が出力したい

Last updated at Posted at 2016-08-14

riot.jsでは、{}の中身は常にエスケープされる。

非常に安心な仕様でありがたいのだが、<br>なんかも使えないため、ちょっと微妙。

公式を見て、納得したような、していないような気分になったので、書いておく。

パブリックな回避方法

raw.tag
<raw>
  <span></span>
  this.root.innerHTML = opts.content
</raw>
使う側
<raw content={memo}></raw>

まぁ、これぐらい縛られるほうが、ポカせずに済みそうですね。
まじめにやりたければ、raw.tagのほうでもう少し修正するとかできるでしょうし。

7
5
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
7
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?