Page 1 of 1

Automatically populate <sep> with &#160;

Posted: Sat Mar 07, 2020 12:04 am
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:

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

Posted: Mon Mar 09, 2020 4:45 pm
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

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

Posted: Fri Mar 27, 2020 9:16 am
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