How To Force a Display of Numeric Character References in Text Edit Mode Rather Than Spaces?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
msharcourt
Posts: 7
Joined: Thu Oct 24, 2013 6:34 pm

How To Force a Display of Numeric Character References in Text Edit Mode Rather Than Spaces?

Post by msharcourt »

What is the proper way to configure the editor in Text Edit Mode to force a display of numeric character references rather than space character glyphs for the following characters?

Unicode Name of the character
U+00A0 NO-BREAK SPACE
U+1680 OGHAM SPACE MARK
U+180E MONGOLIAN VOWEL SEPARATOR
U+2000 EN QUAD
U+2001 EM QUAD
U+2002 EN SPACE
U+2003 EM SPACE
U+2004 THREE-PER-EM SPACE
U+2005 FOUR-PER-EM SPACE
U+2006 SIX-PER-EM SPACE
U+2007 FIGURE SPACE
U+2008 PUNCTUATION SPACE
U+2009 THIN SPACE
U+200A HAIR SPACE
U+200B ZERO WIDTH SPACE
U+202F NARROW NO-BREAK SPACE
U+205F MEDIUM MATHEMATICAL SPACE
U+3000 IDEOGRAPHIC SPACE
U+FEFF ZERO WIDTH NO-BREAK SPACE

Is this a parser configuration issue, a CSS display issue, or something else? Mind that I am not asking how to change the encoding for the output to something such as @encoding="us-ascii" to get NCRs in the output. I am asking how can I see NCRs in the editing view to make it easier to identify cases where non-standard space characters are occurring.
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: How To Force a Display of Numeric Character References in Text Edit Mode Rather Than Spaces?

Post by adrian »

Hello,

There's no way to configure Text mode to display something other than the actual text content found in the file. What you want could probably be done for the Author mode, which is subject to CSS styling.
In Text mode you can only enable whitespace markers (generic) but these can't help you distinguish between them (only tabs and line breaks are distinct).

However, if what you want is to get rid of non-standard space characters, you can configure Oxygen's formatting to treat all of them as whitespaces in Options > Preferences, Editor > Format > XML > Whitespaces. Check the boxes for those you want normalized (replaced with a plain space).
Afterwards you can use the "Format and Indent" action to format the document and these non-standard space characters will be normalized (replaced with a plain space).

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply