In Author mode b-button will break paragraphs

Having trouble installing Oxygen? Got a bug to report? Post it all here.
jelovirt
Posts: 84
Joined: Tue Oct 11, 2005 9:17 am
Location: Helsinki, Finland
Contact:

In Author mode b-button will break paragraphs

Post by jelovirt »

Oxygen version: 10.0

Say you have DITA content

Code: Select all

<p>first second</p>
<p>third fourth</p>
If in Author mode you highlight "second" and "third" as one range and click b-button to bold the text, the resulting XML will be invalid

Code: Select all

<p>first <b>
<p>second</p>
<p>third</p>
</b></p>
<p> fourth</p>
Another use case for this is where you highlight all the columns in a table row and bold them, resulting in invalid DITA.

Would it be possible to implement this so that content is not split and then wrapped in a single b element, but rather (for the first example)

Code: Select all

<p>first <b>second</b></p>
<p><b>third</b> fourth</p>
That is, "insert wrap element" instead of "break wrap element".

Another case where clicking the bold button fails is

Code: Select all

first <keyword>second third</keyword> fourth
If you try to bold "third", this will result in

Code: Select all

first <keyword>second <b>third</b></keyword> fourth
As a user I'm not sure if I'd like (A) the bold to fail because b element is not available in keyword, or (B) break keyword to create

Code: Select all

first <keyword>second </keyword><b><keyword>third</keyword></b> fourth
Radu
Posts: 9438
Joined: Fri Jul 09, 2004 5:18 pm

Re: In Author mode b-button will break paragraphs

Post by Radu »

Hi,

Thanks for the feedback.
Indeed the actions for Bold/Italic/Underline can be improved (not only for DITA but also Docbook, XHTML, etc).
All the Author toolbar/menu actions for a specific framework are configurable from the Oxygen Preferences -> "Document Types" page.
See this link for more details:
http://www.oxygenxml.com/doc/ug-oxygen/ ... us-toolbar

Usually for simple actions like Bold an XML fragment is specified to be used for surround and a certain operation is invoked. In this case the operation SurroundWithFragmentOperation is called.

We'll try to add some more operations in a future version, something like SurroundWithInlineFragmentOperation which should behave the way you suggested and use them for this kind of actions.

In the meantime if you know Java you can make your own extension actions to improve the Bold operation.
See this link for more details:
http://www.oxygenxml.com/doc/ug-oxygen/dg-java-api.html

Oxygen offers an Author SDK which can be used to build your own operations which can get invoked for specific actions in specific contexts.
See http://www.oxygenxml.com/developer.html

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