markText display problem

When displaying the data, instead of displaying the markText, the text inserted when replacingSelection is displayed. I need to convert here, I don’t have a good idea, can you give me an idea?