Answer the question
In order to leave comments, you need to log in
How to handle user content in SPA?
When developing the SPA, a problem arose: if there are code inserts in the user content that connect additional scripts, then they work only during server rendering, and subsequently the script does not run on the client and the widget is not shown.
For example, this is how the Twitter widget code looks like to be inserted on the page:
<blockquote class="twitter-tweet" data-lang="ru">
<p lang="en" dir="ltr">AG Ferguson announces lawsuit against Trump Administration to stop distribution of downloadable “ghost guns,” which anyone can print with a 3D printer <a href="https://t.co/MdSExlQ1jO">pic.twitter.com/MdSExlQ1jO</a></p>
— WA Attorney General (@AGOWA) <a href="https://twitter.com/AGOWA/status/1023993814438952962?ref_src=twsrc%5Etfw">30 июля 2018 г.</a>
</blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question