As markup and text is recognized, handlers are invoked. The following method is used to set up handlers for different events: