XSS and html markup issue

Now select2 can properly escape tags like <script> and any other html tags that were originally escaped. Also, escape function is being called only at the root of content generation instead of at every place.