Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Apr 2012
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Auto insertion of <p> tags in text file

    I am cutting and pasting a long Word doc into Coffee Cup. The doc. file has paragraphs indicated only by an indentation on the first line. There is no double return (white space) between adjacent paragraphs.

    In Coffee Cup, even though the indent is lost, paragraphs can still be determined based upon the unequal length of the last line in one paragraph and the first line in the next.

    Is there anyway this, or another method, can be used to "auto-insert" <p> </p> tags; eg. not having to enter hundreds (thousands) manually for an entire book?

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello pnielsen,
    I don't have Coffee Cup but DreamWeaver will do it automatically easy enough. Just paste your text into the Design View window and it puts paragraph tags where they need to go.
    I just tried and it's actually pretty good at it. I thought it was adding an extra <br> but the document I was copy/pasting had an extra space between each paragraph so DW even sees empty line breaks.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    Apr 2012
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I also have Dreamweaver, and yes there is a menu import option to retain formatting from MS Word. However, I heard some Dreamweaver HTML tags are not recognized by eBook readers. Should be OK for just text blocks though.

    Unfortunately, in my DW installation the "import from Word" option is greyed out. Will need to check out why. Maybe because Word is not installed on this computer(?)

    However ... I just tried a cut-and-paste as you suggested, but with an RTF. Looks good. Maybe it would be better for this purpose to simply re-save the Word document as RTF anyway(?)

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    It wasn't that complicated when I did it. I just opened a new .html document, pasted into Design View, went to code view there's paragraphs formated with <p> tags.

    I have not tried the import from word button yet...


    edit// -- File/Import/Word Document... becomes available when you goto Design View. It is grayed out in Code View where it is not available. It does just as good a job as pasting into design view.
    Last edited by Excavator; 11-06-2012 at 10:25 PM. Reason: tried importing a word doc
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    pnielsen (11-07-2012)

  • #5
    New Coder
    Join Date
    Apr 2012
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts
    When I try that with an RTF save from Word, there are <p> tags at the beginning of each paragraph, but <br>'s at the end. Then it is a simple matter to find/replace the latter, and reinsert any required <br>'s since there are far fewer of them ... or just work around them section by section. It also seems RTF carries through less of the Word coding.

    My Word import button in DW CS5 is grayed in both views. Don't know why.

    Thanks for your help in resolving this problem. Will save alot of time.

  • #6
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by pnielsen View Post
    Will save alot of time.
    I can imagine!
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •