wrapping PRE-tagged paragraphs

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
pdenchfield
Propellus Maximus
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA
Contact:

wrapping PRE-tagged paragraphs

Post by pdenchfield »

My Flare topic includes paragraphs that are tagged with <pre> to preserve extra spaces and tabbing. However, long lines extend off the page.

How can I get my PRE-tagged paragraphs to wrap?

The excellent ideas posed on the following websites to define PRE in the stylesheet don't appear to work with Flare.
http://www.sohtanaka.com/web-design/sty ... ode-block/
http://cssforlunch.com/make-the-pre-tag-wrap/

When I apply these changes to my .css (stylesheet) file, the code gets wrapped, but then all the preserved spacing goes away.

Any ideas out there?
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: wrapping PRE-tagged paragraphs

Post by KevinDAmery »

Just to clarify, is the spacing disappearing in the XML editor, your built output, or both?
Until next time....
Image
Kevin Amery
Certified MAD for Flare
pdenchfield
Propellus Maximus
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA
Contact:

Re: wrapping PRE-tagged paragraphs

Post by pdenchfield »

Hi Kevin, the spacing is disappearing from both the editor and my output when I try the CSS changes I posted.
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: wrapping PRE-tagged paragraphs

Post by KevinDAmery »

Ok, which output type? (Webhelp, CHM, some variety of print?)

If it's webhelp, just to make sure that it's really a Flare issue and not just a CSS / browser issue, try editing the CSS file of the built output to include the changes from those sites. (Or even try creating a simple web page outside of Flare with a CSS that uses that code.) Then open the site with the modified CSS and see what it does.

As both of the sites you reference mention, each browser deals with PRE differently, and the one with the wrap could says that it "should cover all bases" - I'd emphasize the word *should* in that statement. The intent of PRE is to show the content of the tag exactly as it appears in the html file, so applying code to make it wrap or indent is technically a hack to get around the intended behaviour - there's no guarantee that a browser will interpret it the way you want it to.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
siskamoens
Propeller Head
Posts: 85
Joined: Wed Mar 21, 2007 3:01 am
Location: Belgium
Contact:

Re: wrapping PRE-tagged paragraphs

Post by siskamoens »

If you want to see how the browser interprets the different css files involved (yes, there are hidden css files in Madcap!) and you use Firefox, then you can install the Firebug add-on - http://getfirebug.com.
It has helped me tremendously in troubleshooting css issues!

Siska
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: wrapping PRE-tagged paragraphs

Post by NorthEast »

The pre tags in my template wrap ok (and keep their spacing), my pre tag styles are:

Code: Select all

pre
{
	width: auto;
	overflow: auto;
	white-space: pre-wrap;
	word-wrap: break-word;
}
pdenchfield
Propellus Maximus
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA
Contact:

Re: wrapping PRE-tagged paragraphs

Post by pdenchfield »

Hi Dave, I tried your code in our .css file and generated WebHelp and PDF outputs. No wrapping occurred in either output. (In the WebHelp, I got a scrollbar to view the full code. In the PDF, the code went off the page - there's no way to see the end of the line.)

Any ideas why this isn't working?

Thanks!
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: wrapping PRE-tagged paragraphs

Post by KevinDAmery »

What output format are you building? If it's webhelp, have you tried it in a couple of different browsers?
Until next time....
Image
Kevin Amery
Certified MAD for Flare
pdenchfield
Propellus Maximus
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA
Contact:

Re: wrapping PRE-tagged paragraphs

Post by pdenchfield »

WebHelp was one of the outputs I tried. The other was PDF.

The only browser I tested in was IE7.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: wrapping PRE-tagged paragraphs

Post by NorthEast »

I'm not sure why it's different for you, it works for me in browsers, but not in PDF.

Saying that the default pre tag (with no styles) has the same problem in PDFs (cropped text with no wrapping), I'm unsure what CSS you'd need to use for PDF targets.
pdenchfield
Propellus Maximus
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA
Contact:

Re: wrapping PRE-tagged paragraphs

Post by pdenchfield »

See my more comprehensive posting about scrolling/wrapping code at http://forums.madcapsoftware.com/viewto ... =6&t=10349.
Post Reply