May change 'p' element checking to custom variable to make possible to assign custom element as caption.