We have textarea:

<textarea ng-init="testConditionEdit='<?php echo htmlentities(Tests::getTestCondition($idBlock));?>'" ng-model="testConditionEdit"></textarea> 

We load a certain html block from the database into the model in the ng-init directive, which may have different special characters, etc. The htmlentities function helped to convert special characters. But I got a block on which an error appears in the console

Here is this html block:

 <p style="font-family:'Pt Sans', Arial, sans-serif; font-size: 15px; font-style: normal; "> 8. Эксплуатация</p> 

Swears on 'Pt Sans' . I understand that it is correct to pull data into a model not in a view, but as a kind of an angulyar service in the form of jsona. Is there a way to convert a block so that there is no syntax in html itself?

  • Does religion not allow to use a class and fasten a style with an external file? - E_p
  • not a class thing at all. style="font-family:'Pt Sans' - This is an example of content that is loaded from the database. The content may be different. Someone copied the text from Wikipedia, for example. It was saved in the database in this form, and it needs to be pulled into the model - Igor Baranyuk
  • And if the zhabaskript is slipped which steals cookies, hijacks sessions and does other dirty tricks? - E_p
  • Js in content with db? this is the second question) Not all users will fill the content in the database. as an option - Igor Baranyuk

0