1

what happen if a post the following question in stackoverflow?

<script>
alert("javascript");
</script>

In other words, does stackoverflow sanitize the question text?

2

1 Answer 1

5

The question text is sanitized. Only a (very) small subset of HTML is tolerated.

<script> tags are not included in the whitelist. Only a very specific set of attributes are allowed, and only on <img> and <a> tags. Use attributes anywhere else and the tag is stripped completely.

Not the answer you're looking for? Browse other questions tagged .