Automatically populate <sep> with &#160;

Oxygen general issues.
GregWait42
Posts: 8
Joined: Wed Feb 19, 2020 10:52 pm

Automatically populate <sep> with &#160;

Post by GregWait42 »

I'm trying to create a solution to some of our writers using a space or simply not populating <sep> elements. I thought I could just customize Content Completion Assistant so that <sep> elements would be automatically created with a non-breaking space inside them (&#160;). Unfortunately, it looks like I'm limited to choosing an existing element.

Is there a way to do what I'm trying to do so that when a user selects "sep" from Content Completion Assistant Oxygen automatically places "<sep>&#160;</sep>" in the file?

Thanks in advance for any tips/guidance!

Regards,
Greg
(Now available in chunky!). :lol:
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: Automatically populate <sep> with &#160;

Post by alex_jitianu »

Hi Greg,

I think I understand what the problem is (please correct me if I miss something). The content completion configuration file can only control what elements are inserted, not what text should be put into one.

If you are working in Author mode, then a solution is to create an author action that uses the InsertFragmentOperation to insert a fragment:

Code: Select all

<sep>&#160;</sep>
The next step is to configure content completion:
1. add the newly created action in the content completion list
2. remove the built-in "sep" proposal

Best regards,
Alex
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: Automatically populate <sep> with &#160;

Post by Radu »

Hi,

Just to update this thread, I wrote a small article on the Oxygen XML Blog about contributing an Author action to the content completion window:
https://blog.oxygenxml.com/topics/custo ... etion.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply