Skip to main content
Known Participant
January 29, 2014
Answered

Codeblock Element: How do I make it so when I press enter, it doesn'insert another codeblock elem?

  • January 29, 2014
  • 1 reply
  • 661 views

FM 11

DITA 1.2

Currently when I'm entering text in the <codeblock> element, it inserts another <codeblock> element every time I press Enter, like this:

<codeblock> This is the first line. </codeblock>

<codeblock> This is the second line. </codeblock>

<codeblock> This is the third line. </codeblock>

I want it to preserve line breaks like this:

<codeblock> This is the first line.

This is the second line.

This is the third line. </codeblock>

The r/w rule for the codeblock are as follows:

element "codeblock" {

  preserve line breaks;

  }

In my template, in the Paragraph Designer, I have tried setting the Next Pgf Tag as Body and as CodeBlock.

My EDD(s) are set to use the CodeBlock paragraph format.

What simple thing am I missing?

Marsha

This topic has been closed for replies.
Correct answer ScottPrentice

You can't.

Use SHIFT+ENTER instead.

...scott

1 reply

ScottPrentice
ScottPrenticeCorrect answer
Inspiring
January 29, 2014

You can't.

Use SHIFT+ENTER instead.

...scott

Known Participant
January 29, 2014

Thanks, Scott. That's what I've been doing so far.

Marsha

ScottPrentice
Inspiring
January 29, 2014

I think that the "line break" that's being preserved is the SHIFT+ENTER .. pressing ENTER alone always creates a new element.

Cheers!

...scott