What you're doing here feels wrong again. This approach is "text" to show the string "(No reason given)" when that is not the text of the annotation. There is no text/reason, so text should be empty. This also abuses the assumption that the text is markdown in order to manipulate the HTML that is output. Instead, the template should contain the HTML. If emphasis is required, that should be done with CSS by manipulating the classes on the annotations or their parts (in viewer.html or annotation.html) and providing proper styling in the CSS.