Use <div contenteditable="true"></div> instead of entering text. Make an image representing your dash. In the keyup event, replace all dashes with your image. In the submit form, copy the div text, replace the img dash, and then put the text in <input type="hidden" /> .
The reason I say using images instead of the actual dash is because you are not getting <span><span><span>-</span></span></span> .
Alternatively, you can replace "-" with "& ndash;".
source share