Can I apply a span style to a whole paragraph?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Msquared
Propellus Maximus
Posts: 848
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Can I apply a span style to a whole paragraph?

Post by Msquared »

How can I apply a span style to a whole paragraph without defining a separate paragraph style?

I have a style (span.NeedsAttention) that I apply to parts of content that I need to revisit when I can get hold of the SME. It's red. This means that later on I can quickly see what needs sorting out.

Often I apply this style to just a few words in the text, for example, where I'm not sure of the best term to use, but sometimes I have a whole paragraph to mark. But as soon as I select a whole paragraph, Flare offers me the paragraph styles and not the span styles, so I can't select the style. I end up selecting part of the paragraph, setting the style, then selecting the rest and repeating the action.

Surely there must be a better way to apply a span style from the start of the paragraph right up to the end of the paragraph? I'm aware that the style won't be attached to the <p> tag, but will be inside the <p> and </p> tags. That's fine, just so long as I can set it somehow.
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
crdmerge2
Propeller Head
Posts: 29
Joined: Wed Sep 26, 2012 7:19 am

Re: Can I apply a span style to a whole paragraph?

Post by crdmerge2 »

Why not a p.NeedsAttention class with similar styling?


Good luck,
Leon
whunter
Sr. Propeller Head
Posts: 429
Joined: Thu Mar 12, 2009 4:49 pm
Location: Portland, OR

Re: Can I apply a span style to a whole paragraph?

Post by whunter »

If you really want to do it, you should be able to put an empty space on the end of the paragraph, then highlight everything except that space and apply the span.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Can I apply a span style to a whole paragraph?

Post by i-tietz »

Replace the the class span.NeedsAttention with a generic class: .NeedsAttention.
That sort of class you can assign to ANYTHING - doesn't matter if it's a span or a paragraph.
Then you will have to do a global find&replace: class="NeedsAttention" => class=".NeedsAttention"

I did that to float different elements (classes .right and .left) or to get elements use the margin space in print output (class .margin) or to make elements invisible (class .invisible - for mistyped search keywords), or to kick elements out of the help (class .comment), ...
Inge____________________________
"I need input! - Have you got input?"
Msquared
Propellus Maximus
Posts: 848
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: Can I apply a span style to a whole paragraph?

Post by Msquared »

Thanks i-tietz! That's just what I wanted, although I have a couple of questions too.

This works for spans, and for paragraphs that are just my base <p> style. But for paragraphs that already have a class applied (for example, in my case, code fragments, bullets, lists, notes, table data), in my topic XML, Flare has removed the original class and replaced it with the new class, so my old styling has gone. Is this what you would expect, or should I report a bug?

I'm not sure why you said I would need to replace existing class="NeedsAttention" => class=".NeedsAttention"? I unbound my existing span styles (from spans and whole paragraphs) and reapplied the new style. It's still shown in the XML as class="NeedsAttention" (and not class=".NeedsAttention", as I was expecting from your comment). Am I missing something?
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Can I apply a span style to a whole paragraph?

Post by LTinker68 »

First, you wouldn't replace with ".NeedsAttention" -- you don't include the period in the topic. You only use the period in the stylesheet file. So in this example, if you took an existing style and made it a generic style, then you wouldn't have to do any find-and-replaces in the topics.

Second, it's legitimate to apply two classes to an element (e.g., p class="note NeedsAttention", where note and NeedsAttentions are the classes); however, Flare doesn't allow you to do that via the GUI. You'd have to open the topic in the Internal Text Editor and add the second class, but 1) if you ever tried to change one of the classes, it would revert to only one class on the tag; and 2) I'm not entirely sure Flare doesn't still trip out the second class. I think I tried this once and it either didn't work or didn't work for long (reverted), so I ended up making a new generic class that was a combination of the two styles, which is your third option to what was proposed in the previous posts.

Make sure you submit a feature request at https://www.madcapsoftware.com/feedback ... quest.aspx asking for the ability to specify multiple classes on the same tag.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Msquared
Propellus Maximus
Posts: 848
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: Can I apply a span style to a whole paragraph?

Post by Msquared »

Thanks LTinker68. I too have come to the conclusion that Flare doesn't support a second class for an element. That means I'm going to revert to just my original span class, as much as I like the tidy solution of using a generic class.

Since I can't use the generic class for many of the "paragraphs" that I may want to, since they already have a class, I may as well just select a span that includes most of the paragraph, since then the paragraph class will (usually!) stay intact. This will work for me since this is only a rough and ready way to flag areas to revisit, so it doesn't matter if the formatting isn't applied to quite everything. It's more important that it's visible, and quick, easy and error free to apply and revert without any unintentional side effects.
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
Post Reply