Pages: 1
Print
Author Topic: Customize element creation when editor creates new line  (Read 2700 times)
John Cornellier
Member

Posts: 3


« on: August 21, 2015, 08:21:15 AM »

XMetaL Version#: 8.0.1.052. When writers hit enter in an <li> they wish to see another <li> created, but a <p> is created. Not sure if this is default or because we are using a slightly specialized version of DITA. How do I change this behaviour?
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: August 21, 2015, 11:38:56 AM »

If you are at the end of a list and the last list item contains no content pressing enter finishes the list and the next logical element is inserted (in this case <p> is inserted after the list). If you are at the end of a list and the last list item contains some content then pressing enter adds another list item.

I assume that is what you are seeing?

Assuming the following basic markup as the starting point:
<ol>
  <li><?xm-replace_text List Item?></li>
</ol>


1. Type some text:
<ol>
  <li>some text</li>
</ol>


2. Press enter:
<ol>
  <li>some text</li>
  <li><?xm-replace_text List Item?></li>
</ol>

You can repeat steps 1 and 2 indefinitely to extend any list.

3. After repeating steps 1 and 2 a few times if you press enter without entering anything into the last list item that was created you exit the list:
<ol>
  <li>some text</li>
  <li>some more text</li>
  <li>even more text</li>
</ol>
<p><?xm-replace_text Paragraph?></p>

For a list containing two or more items pressing enter at the end of any list item except the last one will always insert a new list item at that position.

If you are at the very start of a list before all list items (this is only possible in Tags On view) then pressing enter creates a new list before the current one (internally the list is actually being split).

If you are at the very end of a list after all list items (this is only possible in Tags On view) then pressing enter always inserts the next logical element after the list (which for DITA is a <p>).

If you aren't seeing this behaviour then there is probably something wrong with the installation of the DITA authoring functionality and I would recommend reinstalling.
« Last Edit: August 21, 2015, 11:42:27 AM by Derek Read » Logged
John Cornellier
Member

Posts: 3


« Reply #2 on: August 21, 2015, 11:59:30 AM »

Thanks for the quick reply. What I'm seeing is the following:

With the following basic markup as the starting point:
<ol>
  <li><?xm-replace_text List Item?></li>
</ol>

1. Type some text:
<ol>
  <li>some text</li>
</ol>

2. Press enter:
<ol>
 <li>some text</li>
  <p><?xm-replace_text Paragraph?></p>
</ol>

So according to what you wrote there is "probably something wrong with the installation of the DITA authoring functionality" but I can't reinstall the DITA part. Long story short, it's a standard environment I have to work with. I've requested a fix but it's not forthcoming. Was hoping to do a local hack as it's very annoying for the writers. I realise this is probably not a XMetaL problem but it'd be great if I could fix it with for e.g. C:\Program Files (x86)\XMetaL 8.0\Author\DITA\XACs\1.1\topic\topic_ditabase.ctm.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: August 21, 2015, 02:21:39 PM »

I think you must be using specialized DITA DTDs because the <p> element is not normally allowed directly inside an <ol> for the standard DITA DTDs.

If so, the CTM file associated with your specialized DITA DTD would need to be modified. You would need to add new entries to the <FollowedByList> section. The items in that list are checked in order, so whatever you add should be added prior to anything else that can be legally inserted. When a specific item is not found in this list that can legally be inserted then the fallback is to try items from the <Paragraphs> section of the CTM file (in order) and if there is nothing from that list that can be legally inserted then the final fallback is to try to insert the same element as the current one.
Logged
Pages: 1
Print
Jump to:  

email us