View Full Version : Paragraph ending hassle
Greiggy
Sun., Jun. 19, 2005, 4:38 pm
On our site we put up a fairly full summary of the message on a template which includes some visual material (it's actually a deep 2 cell table).
However I put the text into the text column, I have to work on the para endings. The text will appear all closed up, no paras at all. I have to insert a para ending in each para, which brings another line space as well. Then I have to drop down to the beginning of the next line and delete the line space to get evenly spaced paras with a line between each.
I can't seem to find a way of preparing the text so that I get each para separated by one line of space, without quite a lot of work. The solution is probably obvious but I'm not seeing it . . . Suggestions?
David Gillaspey
Sun., Jun. 19, 2005, 8:54 pm
Hi Greiggy,
I think it's actually pretty easy. Surround your paragraphs with the <p> and </p> tags. Example:
http://www.greatchurchwebsites.org/paragraph_example.html
The paragraphs should appear to be double spaced (actually, it's a default space after attribute).
Years ago, though, I found that this didn't always give me what I wanted, with the existing browsers at that time. Maybe one of the browsers available then didn't add paragraph spacing.
So, to ensure you get paragraph spacing after, and to allow you to control how much, use CSS.
In this example,
http://www.greatchurchwebsites.org/paragraph_example2.html
I have the following code at the top, between <head> and </head>:
<style type="text/css">
<!--
p { margin-bottom: 9px;}
-->
</style>
Actually, Example 2 probably won't look any different to you than Example 1, but if you changed the "margin-bottom: 9px;" to something like "margin-bottom: 300px;" (only for a test!), the difference would be obvious.
Sometimes, it's the padding-bottom attribute that you specify to accomplish a goal. I always have to experiment to determine whether I should use margin or padding.
So, CSS is the answer. However, there is more than one way of going about using CSS to get the paragraph space after effect. Others on the forum who know more about CSS than I do can provide detailed solutions. I just want you to be assured there is a solution.
Sincerely,
David Gillaspey
President
Great Church Websites
Greiggy
Mon., Jun. 20, 2005, 7:49 am
I'm using CSS throughout and I can regulate the exact amount of white space OK ? it's just the hassle of getting the extra line spaces out of the copy.
Is there a quick way of getting the <p> and </p> around all the paras, like a setting or script in BBEdit or something?
David Gillaspey
Mon., Jun. 20, 2005, 9:01 am
I'm using CSS throughout and I can regulate the exact amount of white space OKBut you wrote, "The text will appear all closed up, no paras at all." Nor did you mention that you were using CSS.
So I answered the question as you presented it.
I have some ideas of how to achieve your goals, but I (and forum members) will need more information to help you. Please provide details about what software you are currently using (start to finish in the process), and examples.
Sincerely,
David Gillaspey
President
Great Church Websites
Greiggy
Mon., Jun. 20, 2005, 9:42 am
Sorry to be unclear -- wanted to keep the post as short as possible.
Yes, I'm using CSS. This is what I do (you may say I'm heading out on the wrong side of the road -- occupational hazard of being English ;8-)
I copy and paste the text into the 'template page' (not a proper template, probably a copy of last week's). The text will appear all closed up.
I put a line space at the end of each para.
This results in a 2 line space between paras.
I delete one line space from the beginning of each para to get the one line space I want. Apply the CSS style for t he body copy. Pull out the headings into a CSS heading style.
This is in Dreamweaver MX.
At present I don't edit the text beforehand, just paste it in, but I'm wondering if I should edit it with the <p> and </p> tags before pasting it into my page 'template'.
Here's the link to this week's ? if you scroll down a fair way you'll see why I use the two cell table layout.
Greiggy
Mon., Jun. 20, 2005, 9:43 am
Link omitted on earlier post:
http://www.shinfield-baptist.org.uk/RECENT_WEEKLY_CONTENT/2005%20w-content/June_05/June_19th/June_19th_Summary.html
David Gillaspey
Mon., Jun. 20, 2005, 12:04 pm
Hi Greiggy,
Thanks for the additional detail. I understand now what the problem is.
I am able to reproduce the problem you are experiencing. So I'll start by explaining what's happening.
First, it's important to understand that in a word-processing program, returns are actual characters, albeit normally invisible. (You can, however, choose to see return characters, by turning on Word's "Show Invisible Characters" option. [This is "verbal shorthand"; I'm not saying the feature is called exactly this.])
Since a return is a real character, you can search for all returns in a file and replace them with some other character or characters. That's the key to the ineloquent solution I'll explain below.
The problem you are experiencing occurs because when you paste text into Dreamweaver, by default it converts all these invisible returns to the <br> tag. It surrounds all the copy with a single pair of <p></p> tags, rather than doing this on a paragraph by paragraph basis. Since there is only one <br> tag after each paragraph, your text appears closed up, as you say.
Then, in Dreamweaver, when you manually hit the Return (or, on the PC, the Enter key), Dreamweaver inserts the </p> (at the end of a paragraph) and <p> (at the start of the next paragraph) tags (actually before the existing <br> tag, which is odd). That's why you get the double spacing.
This points to a feature that Dreamweaver sorely lacks: the ability to take paragraphed copy and automatically surround each paragraph in it with <p> and </p> tags upon a paste operation. There may be a Dreamweaver extension that does this, however.
Anyway, one solution is to use Dreamweaver's own Find/Change command to search for instances of </p><p><br> and replace them with </p><p>. Be sure to search in the Source Code, not text. Unfortunately, when I tried this, it left </p><p> at the end of paragraphs, rather than putting the <p> at the start of the next paragraph.
So try this solution: in MS Word, you search for paragraph returns (that actual character I've mentioned) by searching for "^p" (without the quotes) ? or possibly "^l" (without the quotes; the second letter is the lowercase of "L"). I mention both possibilities because I have had to use both in different circumstances. Regardless, in Word's Find/Change dialog box, there is a place for specifying a variety of "Special characters," including paragraph returns.
Search for all instances of paragraph returns, and replace them with:
</p>^p<p>
(or possibly)
</p>^l<p>
The point of this is to add the necessary HTML tags to the text before you paste it into Dreamweaver.
(Note: add an extra line of space above all the text first, else the first paragraph won't get the <p> tag in front of it.)
Then, when you paste the text into Dreamweaver, be sure to use the "Paste HTML" option under the Edit menu, else you'll get the <br> tags again.
Now, that's not a very eloquent solution, but it works. It's possible you could use a Word macro to automate it. Also, if you are using a Mac, BBedit (http://www.barebones.com/index.shtml) might have a feature that would do this for you.
For the PC, consider:
http://www.tucows.com/preview/376599
http://www.tucows.com/preview/316293
http://www.tucows.com/preview/390891
and NoteTab (http://www.fookes.com/notetab/index.php)
I believe the latter is the current incarnation of software for Windows that I previously used (but the name of which I could never remember) and found to be very powerful.
Sincerely,
David Gillaspey
President
Great Church Websites
Greiggy
Mon., Jun. 20, 2005, 3:37 pm
Very helpful, David. I can work with this.
I have BBEdit and I also have Nisus which is scriptable and has GREP search and replace, so it almost certainly has the means to do the job. Thanks for pointing me in the right direction.
David Gillaspey
Tue., Jun. 21, 2005, 9:14 am
Thanks for pointing me in the right direction.You're welcome.
I wanted to test BBEdit before submitting my reply, but it only installs on OSX 10.3.something, while I have 10.2.8. I have to wonder what feature 10.2.8 is missing that would disable a text processing program. ;)
One more piece of information, as background: On the PC, the return character is actually a Carriage Return (CR) + Line Feed (LF). This mirrors the physical action involved with using a typewriter (remember those?).
On the Mac, a return is just a Carriage Return. On Linux, a return is a Line Feed.
Usually the distinction is not important, but sometimes it can trip a person up. Note that Dreamweaver allows the user, in Preferences (under "Code Format"), to choose one of the above Line Feed types.
I remember doing some task in the last year in which the selection of proper Line Feed type was critical.
Sincerely,
David Gillaspey
President
Great Church Websites
Greiggy
Thu., Jun. 30, 2005, 3:16 am
Does anyone know of a Dreamweaver extension (or even a DW setting) that would help the import process i.e. to produce cleaner html with <p> and </p> round the paras and not too much else?
Or maybe you have a pet way of doing the text imports relatively effortlessly?
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.