I am experimenting with hyphens (e.g. non breakable space, soft hyphens, …)
My ultimate goal is for the ‘content model’ (i.e. the serialized representation of the PM document) to carry any of the information related to hyphens in it - as that representation is something I would like to work with on the back-end. However, I’m seeing some behavior that I simply do not understand and would like to get some information about.
non breakable space
In my experiment I have a button that allows me to enter a non breakable space. I use
tr.insertText('\u00a0') which in my PM view does result in the expected behavior - an entered whitespace. However the ‘content model’ (serialized DOM) changes this to a named entity
. Is there a way to have it emit the hex entity instead of the named entity? Reason I ask is because that would make treating the ‘content model’ as the base for XML easier.
soft-hyphen Similarly I have an experiment with the Soft Hyphen (SHY, see below demo). Along with a button to enter a SHY, I’ve also added a button to ‘reveal/toggle information about that’ (decoration). Somehow PM does have the information of where the SHYs are entered (as they can be shown). However, the information about these hyphens do not seem to be present in the ‘content model’ (serialized DOM) (or maybe they are, but I need to read/process that information differently. Could someone explain this to me?