I need to insert HTML markup (spans, classes, h2 tags). However, webform appears to be filtering out all markup from labels. Has anybody succeeded in inserting html markup in labels, and how did you do that?
You won't be able to use HTML markup within the label inputs within the Webform module itself, as it most likely cleans out all HTML markup before displaying to the user to prevent XSS attacks etc.
Most likely you'll need to write a small custom module which implements hook_form_alter, which will allow you to change the markup used for the labels.
I'm not actually sure if Drupal will allow markup within the #title attribute of your form elements, so you might need to use the #prefix property instead to add your custom HTML replacement labels.
If this is all Greek to you then you'll probably need to checkout these tutorials:
the "Options with Markup" module allows HTML formatting of labels for radio button/checkbox.https://www.drupal.org/project/webform_optionsmarkup
I added the following to the bottom of my settings.php page. I read it somewhere... works like a charm. :)
$conf['webform_allowed_tags'] = array('a', 'em', 'strong', 'code', 'img', 'ul', 'li', 'u', 'span style="font-style:italic', 'span' , 'a', 'i', 'italic');