Home › Forums › General XMetaL Discussion › Insertion of zero-width spaces › Reply To: Insertion of zero-width spaces
Reply to: Insertion of zero-width spaces
November 9, 2011 at 2:21 pmThank you for the reply.
Given that a zero-width space is a valid Unicode character and we're saving our content in UTF-8, there will be no way to force XMetaL to always handle/display the zero-width spaces as a character entity reference. Truth be told, this is the way it *should* work.
In our case, authors need to know where the zero-width spaces are located since the authors are, in fact, introducing them. We use our single-source publishing system to produce both help and PDF/ODT outputs and the zero-width spaces are added to allow a long unbroken string to break at an opportune point when required by the limitations of the output format. To enable the publishing engine to do this automatically would require a very complicated heuristic to choose where to break long unbroken content of several different types (command name, paths, API names, etc.). Consequently we allow the authors to specify where breaks are appropriate, if necessary.
I guess the best way to implement this is to take a hybrid approach: I'll alter the insertion script to insert a processing instruction instead of the Unicode zero-width space character and have our publishing engine convert the PI to a zero-width space at publishing time. That way the PI placeholder is visible in the editor without comprimising ability to edit the surrounding content, and the correct character is introduced automatically in the output.
Thank you for your help in this matter.
Best regards,
Paul Anderson
Information Developer, Compuware Corporation