You may find those two elements useful:
https://github.com/Juicy/juicy-html
https://github.com/Juicy/imported-template
They let you include safe HTML, or load partial from external files - with
Polymer data-binding still working.
BR,
Tomek Wytrębowicz
W dniu czwartek, 28 lipca 2016 13:47:56 UTC+2 użytkownik nawras albaghdadi
napisał:
>
> I'm getting a JSON feed by iron-ajax, in the returned JSON come with HTML
> tags like this.
> [{
> pk :1,
>
> - body: "<p>ثم سكان بشرية الأبرياء عدد, كلّ يقوم الطرفين و. وبدأت
> انذار عل بحق, تكبّد إستيلاء الأثناء، دنو بـ, عالمية العالم، بالمطالبة قد
> الى. وزارة السبب التّحول فصل بل, كل والتي واشتدّت وايرلندا بعض. إحتار
> واندونيسيا، بلا لم, بوابة الفترة بين بل. </p> <p>ثم سكان بشرية الأبرياء
> عدد, كلّ يقوم الطرفين و. وبدأت انذار عل بحق, تكبّد إستيلاء الأثناء، دنو
> بـ,
> عالمية العالم، بالمطالبة قد الى. وزارة السبب التّحول فصل بل, كل والتي
> واشتدّت وايرلندا بعض. إحتار واندونيسيا، بلا لم, بوابة الفترة بين بل.".</p>
> <p>ثم سكان بشرية الأبرياء عدد, كلّ يقوم الطرفين و. وبدأت انذار عل بحق,
> تكبّد إستيلاء الأثناء، دنو بـ, عالمية العالم، بالمطالبة قد الى. وزارة
> السبب
> التّحول فصل بل, كل والتي واشتدّت وايرلندا بعض. إحتار واندونيسيا، بلا لم,
> "بوابة" الفترة بين بل.</p> <!-- Images Box --><div class="img_box01"> <img
> class="img-responsive" src="url" alt=""><p>عبد المالك نبيل بوتيجان</p>
> </div> <!-- Video --><div class="box video_box"><div
> class="head"><h2></h2></div> <p>وأدرج بوتيجان على قائمة التطرف منذ 29
> حزيران/يونيو لمحاولته التوجه إلى سوريا مرورا بتركيا، بحسب مصدر قريب من
> التحقيق.<br /> كما أن المنفذ الثاني يشبه إلى حد كبير مشتبها به تبحث عنه
> السلطات منذ 22 تموز/يوليو أي قبل ثلاثة أيام من الاعتداء الذي تم في كنيسة
> سانت اتيان دو روفريه بالقرب من روان (شمال غرب).</p> <p>وكان جهاز أجنبي
> أبلغ
> هيئة تنسيق مكافحة الإرهاب بوجود رجل لم تعرف هويته "مستعد للمشاركة في
> اعتداء
> على الأراضي الفرنسية"، وأرفقت بالبلاغ صورة لشخص يشبه كثيرا عبد المالك
> بوتيجان.</p> <!-- Images Box --><div class="img_box01"> <img
> class="img-responsive" src="url" alt=""><p>عبد المالك نبيل بوتيجان</p>
> </div> <!-- Video --><div class="box video_box"><div
> class="head"><h2></h2></div><div class="content"><div
> class="arena"><video id="url" dir="ltr" class="video-js
> vjs-big-play-centered vjs-default-skin" controls preload="auto"
> width="600"
> height="338" poster=""><source src="url" type="video/mp4"></source><track
> kind="captions" src="" srclang="en" label="English"><track kind="captions"
> src="" srclang="ar" label="Arabic" default><p class="vjs-no-js">To view
> this video please enable JavaScript, and consider upgrading your web
> browser</p></track></track></video></div></div><div
> class="foot"></div></div>",
> -
>
> }]
>
> so I create a dom-repeat element to show the results , but when printing
> the [[body]] , it prints out as text with the HTML tags as text also, so
> how to print it out as HTML without facing XSS security .
>
>
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/polymer-dev/01aabd69-e84f-49f7-9480-ed8e8b86f7dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.