Formatting the element content if preserving of white spaces
Oxygen general issues.
-
- Posts: 176
- Joined: Wed Apr 29, 2009 4:55 pm
Formatting the element content if preserving of white spaces
Hello Everyone,
if there are used literal elements in my DocBook document I would expect their content untouched if Format and Indent button is pressed. If content is too long and contains spaces, it is wrapped. As in the next processing of literal element content the white spaces are preserved, there are unwanted spaces in the output.
Can be such behaviour changed somehow or I must avoid using Format button?
The following change of default docbook.css style todoesn't automatically wrap literal content if it is edited in visual mode (so it could be default docbook setting I think), but there is no influence on the result of Format and Indent button.
Is there any solution. Do I something wrong?
Thanks in advance.
Jan
if there are used literal elements in my DocBook document I would expect their content untouched if Format and Indent button is pressed. If content is too long and contains spaces, it is wrapped. As in the next processing of literal element content the white spaces are preserved, there are unwanted spaces in the output.
Can be such behaviour changed somehow or I must avoid using Format button?
The following change of default docbook.css style to
Code: Select all
literal {
font-family:monospace;
white-space:pre; // this line was added
}
Is there any solution. Do I something wrong?
Thanks in advance.
Jan
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Formatting the element content if preserving of white spaces
Hi Jan,
This should do it:
Regards,
Radu
This should do it:
Code: Select all
literal {
font-family:monospace;
white-space:pre-wrap; // wraps visually but does not format and indent
}
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 176
- Joined: Wed Apr 29, 2009 4:55 pm
Re: Formatting the element content if preserving of white spaces
Thanks for quick reply. I've tested it but without success - it seems like the same bahaviour as using 'pre' value. Switching from visual to source mode keeps line not wrapped, but after Format function it still gets wrapped. I hope we understand one to another.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Formatting the element content if preserving of white spaces
Hi,
Sorry for the misunderstanding.
So you are pressing the "Format and Indent" button and want the "literal" tag content to be preserved.
Just go to the Options->Preferences->Format->XML page. There is a list of "Preserve space elements" and you can add "literal" or any other Docbook tag name as an entry there. After that, "Format and Indent" should not touch "literal" anymore.
Regards,
Radu
Sorry for the misunderstanding.
So you are pressing the "Format and Indent" button and want the "literal" tag content to be preserved.
Just go to the Options->Preferences->Format->XML page. There is a list of "Preserve space elements" and you can add "literal" or any other Docbook tag name as an entry there. After that, "Format and Indent" should not touch "literal" anymore.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service