trigger events when paragraphs are opened and closed (other elements might follow)