fix bold and italic functions to work correctly with linebreaks