Drupal has a great system of text formats and filters to help limit markup and do other creative things, like rendering embed tokens. These are applied when a formatted text field, like a node’s body field, is being prepared to render on the front end.