wrapping PRE-tagged paragraphs

This forum is for all Flare issues related to styles, stylesheets and XML.

wrapping PRE-tagged paragraphs

Postby pdenchfield on Tue Mar 17, 2009 2:41 pm

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/styling-pre-tags-with-css-code-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?
User avatar
pdenchfield
Propellus Maximus
 
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA

Re: wrapping PRE-tagged paragraphs

Postby KevinDAmery on Wed Mar 18, 2009 5:28 am

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
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

Postby pdenchfield on Wed Mar 18, 2009 6:50 am

Hi Kevin, the spacing is disappearing from both the editor and my output when I try the CSS changes I posted.
User avatar
pdenchfield
Propellus Maximus
 
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA

Re: wrapping PRE-tagged paragraphs

Postby KevinDAmery on Wed Mar 18, 2009 7:54 am

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
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

Postby siskamoens on Wed Mar 18, 2009 8:04 am

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
siskamoens
Propeller Head
 
Posts: 85
Joined: Wed Mar 21, 2007 3:01 am
Location: Belgium

Re: wrapping PRE-tagged paragraphs

Postby Dave Lee on Wed Mar 18, 2009 8:51 am

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;
}
Dave Lee
Master Propellus Maximus
 
Posts: 5750
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: wrapping PRE-tagged paragraphs

Postby pdenchfield on Wed Mar 18, 2009 11:29 am

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!
User avatar
pdenchfield
Propellus Maximus
 
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA

Re: wrapping PRE-tagged paragraphs

Postby KevinDAmery on Wed Mar 18, 2009 11:52 am

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
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

Postby pdenchfield on Wed Mar 18, 2009 12:05 pm

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

The only browser I tested in was IE7.
User avatar
pdenchfield
Propellus Maximus
 
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA

Re: wrapping PRE-tagged paragraphs

Postby Dave Lee on Thu Mar 19, 2009 2:54 am

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.
Dave Lee
Master Propellus Maximus
 
Posts: 5750
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: wrapping PRE-tagged paragraphs

Postby pdenchfield on Wed Jan 13, 2010 2:35 pm

See my more comprehensive posting about scrolling/wrapping code at http://forums.madcapsoftware.com/viewtopic.php?f=6&t=10349.
User avatar
pdenchfield
Propellus Maximus
 
Posts: 574
Joined: Tue Oct 03, 2006 7:56 am
Location: Seattle, WA


Return to Styles, Stylesheets and XML

Who is online

Users browsing this forum: No registered users and 7 guests