InsertHTML causes end of paragraph

I have a paragraph with style tags such as:
<body><p style="margin-right=50px">xxxx</p></body>
If I try to insert a table, or a list or a horizontal rule into the content the end paragraph tag is moved to before the insert such as:
<body><p style="margin-right=50px"> x</p><table><tr><td>ttt</td></tr></table>xxx</body>
I have tried the document insertBefore and after routines, the kit insertHTML and HTMLEditorKit insertHTMLTextAction routine. All result in the same problem. I can't even type this into the EditorKit source window and refresh it without it changing. Anyone know how to prevent this?
Steve
Steve

I know table elements are paragraph elements and perhaps that is why it is terminating the previous paragraph. I have not been able to find an answer though and would greatly appreciate one.
Thanks,
Steve

Similar Messages

  • How to get consecutive numbering at the end of paragraphs?

    In a big text some paragraphs, already styled, need a consecutive numbering.
    At the beginning of the paragraph the numbering will create a mess.
    Tried with fake footnotes: Impossible. The text has footnotes and converting the faked ones to text is not available.
    Tried a nice script written by Jong to add/subtract a number on numbered items, but it is restricted to index situations.
    O R I G I N A L                                   R E Q U I R E D
    a. Many years ago.                    a. Many years ago. [1]
    Lucy Smith                              Lucy Smith
    b. Margaret run away.               b. Margaret run away. [2]

    Hi, Camilo:
    First of all,  I was not thinking clearly when I blamed ID for a cross-reference bug. It was my error. Cross-references within a document need to be updated by the author, using the Update cross-references button at the bottom of the Hyperlinks & Cross-References panel, when they're moved or their source content changes. I was thinking about the known issues with cross-references that go between ID document files, which update automatically - performance slows, and sometimes they cause crashes.
    Here's the replacement reply for my previous post #1:
    camilo umaña wrote:
    In a big text some paragraphs, already styled, need a consecutive numbering.
    At the beginning of the paragraph the numbering will create a mess.
    Tried with fake footnotes: Impossible. The text has footnotes and converting the faked ones to text is not available.
    Tried a nice script written by Jong to add/subtract a number on numbered items, but it is restricted to index situations.
    O R I G I N A L                                   R E Q U I R E D
    a. Many years ago.                    a. Many years ago. [1]
    Lucy Smith                              Lucy Smith
    b. Margaret run away.               b. Margaret run away. [2]
    It's not clear if the right-hand numbers are supposed to replace the left-hand numbers while keeping the same sequence, or if you want to retain the left-hand numbers. You can use cross-references to create right-hand numbers from the paragraphs auto-numbers.
    Insert a cross-reference to the paragraph at the end of the text, with a format that captures its autonumber, and adds any ornamentation, like the square brackets in your example.
    If the rightmost number must be positioned at the right margin of the numbered paragraph, no matter how long or short it is, or if it wraps around to new lines, add a right-aligned tab stop to the paragraph style, positioned at the location where you want the number to appear, and insert a tab character in the paragraph before the cross-reference.
    If the left hand numbers are supposed to go away, you can't change the paragraph style to a non-autonumbered style, because you need the numbers that the cross-references capture. So, you need to create a character style that's very small and uses Paper for the text color, to hide the autonumbers. If the smallest point size (IIRC, it's 2 points) leaves too much space at the left of the autonumber, you might be able to reduce it further by using a small value in the Horizontal Scale property of the Advanced Character Formats in the Character Style dialog box. Your example seems to show that the numbered paragraphs are indented, so the space occupied by the hidden autonumbers may not be a problem.
    If the paragraphs are rearranged in sequence, you'll need to use the Update Cross-References button at the bottom of the Hyperlinks & Cross-References panel to update the affected cross-references.
    I'm still not clear about numbers at the end of the paragraphs in square brackets. Are they supposed to be the same value as the auto-number at the beginning of the paragraph, except that they use a numeric display format instead of an alphabetic format?
    I don't know of any code that can work with a find/replace action that can capture a paragraph's autonumber and display it at a specific location. As you've seen, cross-references need to be inserted manually. You might post a query in the InDesign scripting forum to see if someone has figured this out. If there's no complete solution, you might want to ask about a script that searches for the ends of paragraphs of the autonumbered paragraph style and opens the Insert Cross-Reference dialog box.
    Using Quick Apply to execute the Insert Cross-References command, which opens the New Cross-References dialog box, might save some energy for doing the many manual cross-references insertions. Search Google for terms like "InDesign quick apply" without quotes. You can open Quick Apply with a keystroke shortcut - Cmd+Return on Mac. You can type abbreviated commands. I use "rt cr" without quotes for (Inse)rt cr(oss-reference). Opening Quick Apply repeats the last command that was entered.
    Also, if you haven't tried a Google search for phrases like "InDesign numbered list at right end of paragraph," without quotes, give it a try. There are lots of links, including one to this forum article. Perhaps there's a golden nugget among them.
    If you think it's important for ID to be able to place autonumbers at the ends of paragraphs, please post a formal feature request here: Wishform Eventually, some user originated feature requests are incorporated in future ID releases.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Search for end-of-paragraph before end of story? CS6

    Hi,
    Does anybody know of a way to search for a paragraph mark directly
    before an end of story marker? I'd like to get rid of them, e.g., in
    footnotes, where the last paragraph mark causes an unnecessary blank line.
    Thanks,
    Ariel

    I found \z on Mike Witherell's great little chart at http://www.jetsetcom.net/useful-resources/indesign-cs6-resources.html
    End of paragraph, at least in GREP is a location, not a character (the metacharacter is $) and can't be selected or replaced. Every paragraph has one. Paragraphs before the end of story also have a paragaph break, and that's what you are trying to remove at the end of your footnote story.
    @David, Why bother withthe lookahead? \z is the location, so I would presume that the search would start at the end of story and look at the last character. That has to be faster than parsing every break in the paragraph to check for the end of story location after, and there's no possibility that you will actually delete the EOS since it can't actually be selected.

  • End of paragraph

    Hi ,
    I m facing problem in finding end of paragraph in text file through java like we do to find the end of file Using EOF like wise i want to find out the end of paragraph.
    Do u have any solutions for this.

    think about what would idenitfy the end of a paragraph
    think about how to read the file
    rinse and repeat
    heres a hint -
    if a new paragraph starts another one most likely just ended.

  • GREP reference; need end-of-paragraph expression

    GREP reference; need end-of-paragraph expression
    I'm doing a canned GREP search to delete all trailing zeros. So if I have a number like 8.2500, it changes it to 8.25.
    I have the code to find zeros leading up to a space, line break, and paragraph return but I can't find the expression for an end of paragraph. With hidden characters on, it looks like a hash ( # ).
    Does anyone know what this is?
    If anyone knows a more elegant way to do this, please advise. Here's what I have:
    0+$|00+$|000+$|0000+$|.0000+$|0+\s|00+\s|000+\s|0000+\s|.0000+\s|0+\n|00+\n|000+\n|0000+\n |.0000+\n|0+\r|00+\r|000+\r|0000+\r|.0000+\r

    See my answer in the Script forum: http://www.adobeforums.com/webx/.3bbf275d.59b4d546/0
    (You shouldn't post a question twice.)

  • Insert End of Paragraph mark before any superscript number

    I am formatting a Bible for a client. The text was provided with verse numbers before each verse, but each chapter is one long paragraph. Now the client has decided they want each verse to begin a new paragraph. How can I globally insert an End of Paragraph mark before each superscrpt verse number?

    In case it helps, and for what it's worth, here's what I assumed:
    As in many bibles, the superscript verse number is simply mixed in the text, preceeding the first sentence of the verse. Could be anywhere, and there is no other special treatment involved. Like this:

  • How do I include the End of Paragraph character with the other characters in a GREP definition?

    I have a character style that changes the line spacing.  The GREP definition that applies it is a period.  This selects everything bu t the Endo of Paragrpah character (EOP).  The result is that the entire paragraph reformats but the last line of text has the wrong spacing.
    I am new to GREP and have not yet found a way to include the EOP character in the change.  I have tried  the statement :    .*$   but that has no affect.

    JES5910 wrote:
    Try defining a paragraph style with a smaller font and leading size then the default style and apply it to the pragraph using GREP definition of a period (all characters).
    That's exactly what I did. I started with 12/14 and changed to to a style using 8/9. Everything changed.
    There is no need to select all the text in a paragraph to assign a paragraph style since the style is aparagraph level attribute. You cannot have more than one paragraph style applied to a single paragraph, so it is IMPOSSIBLE that the end of paragraph marker has a different paragraph style applied than the rest of the paragraph. It IS possible, however, to apply a different character style or local formatting to it (and that's one reason it's better to use a triple-click instead of dragging to select an entire paragraph), so if the last line is not picking up the corrct spacing, the EOP character is either character styled or locally formatted.
    The only way you would know if this is the case is by selecting the EOP character, either as part of the entire paragraph, or by itself. If the paragraph style is then listed with a plus sign, there's local formatting applied. If not, check the character styles panel and I think you'll see a character style applied there (it would say mixed if you've selected the entire paragraph, unless of course you've applied the same character style to everything, which would be a major mistake).
    You can use GREP to remove the character style, if that's what it is, by searching for \r and in the change format set the character styel to [None]. This would work for all paragraphs regardless of waht the leading should be. If the incorrect specification is a local format, however, you would have to either select all text and remove local formatting (which might remove somethign you want, as well) or set up GREP searches to look for the \r with the correct paragraph style in the find formatting, then change the leading explicitly for that style inthe change formatting.

  • Find/change using end of paragraph marker /p

    Folks,
    We are attempting to remove a space at the end of a paragraph in unstructured documents.  If I enter ' \p' in the Find text field in the Find/Change dialog FrameMaker finds the the appropriate paragraphs.  If I then enter '\p' in the Change text field in the Find/Change dialog and click Change the space is removed.  However the target paragraphs style is also applied to the the following paragraph.  This occurs in FrameMaker 8,9 & 10.
    If the Find/Change scenario above is followed with these two paragraphs the first paragraphs style is applied to the second paragraph.
    paragraph 1 with a trailing space and using Heading 1 style
    paragraph 2 using Heading 2 style
    Any thoughts?
    regards
    Jon

    JonEBe wrote:
    Arnis,
    Thanks!
    Yes why bother indeed!  I am at the end of a rather lengthy process to convert the creation and output of Framemaker documents into a database with a web front end.  As part of this the existing documents are imported to save lengthy keying/rekeying.  The output from the system is then compared against the originals.  As a matter of course I stripped of leading or trailing spaces (it is amazing how many there are in a manually created/updated document) so we therefore have noisy comparison documents as a result.
    BTW the trailing spaces are apparently a legacy of the conversion from WordPerfect.
    My choices are to re-import without stripping the trailing space and remove them at a later date or create a script using the FDK, which I am very familiar with, and is the likely outcome!
    Jon
    Just a wild thought - a real GREP processor, not the mild imitation in FrameMaker, can find a construction like a space followed by a paragraph marker and delete the space without affecting the marker. The technique is a form of the "lookbehind" or "lookahead" feature. I'm zero-skilled at actually doing this beyond just mentioning it, but the technique might work in a MIF, or text conversion, of the file. Search Google for terms like "GREP lookbehind lookahead," without quotes.
    Another possibility is that once the FrameMaker file is converted to the database, it would be possible to use a database command to remove the space.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Place glyph at end of paragraph?

    I am putting together a cookbook. I'd like to put a glyph at the end of the last sentence for each recipe. (Basically, the final instruction.)
    Is it possible to create a paragraph format that includes a glyph at the end? Or would I need to rely on GREP to search for the end of the last paragraph for each recipe, then insert the desired character?
    If the answer is GREP, since it has been donkey's ages since I last used GREP regularly (and it wasn't in InDesign), is there a good resource for learning InDesign's GREP?
    Many thanks to this wonderful community! I always get swift, excellent answers.

    For the vast majority of the text, it already exists in FrameMaker 7.2. I am just porting it over to InDesign CS5. Since I am applying paragraph formats, I could, while in each recipe, go ahead and manually enter for the last paragraph for each recipe, but then if I am manually entering something, I might as well manually enter the glyph. I was hoping to avoid manual work as much as possible. :-)
    I will experiment and report back. I may decide not to do the glyph, since I already have several other design elements for each recipe and I don't want the pages to look too busy. The end of one recipe and the start of the next is quite obvious anyway from the formatting of the recipe title paragraph.
    Thank you both so much for your help!

  • GREP to Add a Carriage Return at End of Paragraph

    The following search criteria adds a return at the beginning of a paragraph
    Find
    ^.
    Change to:
    ~b$0
    Now I want to instad add a carriage return at the end of the paragraph instead, so I changed my search criteria as shown below, but never get the carriage return. How do I add a carriage return to the end of a pararagh?
    Find
    \z
    Change to:
    ~b

    Peter
    Thanks for your help. I want to create a new, empty paragraph so I can apply a different paragraph style to it than the paragraph style used in the preceding paragraph. Once I have that, I will cut and paste text into the new paragraph that uses the just applied paragraph style.
    Or perhaps more simply, move text that already has a paragraph style applied  to it into a new location, but first have that new location set up with the correct paragraph style so that the formatting is not lost.
    Hope that makes sense.

  • XSL:Import causing End-Of-Communication error when called in PL/SQL.

    I have master xsl. I am importing another xsl in it. when I use xslTransform in my pl/sql stored procedure I receive end of communication error. I have used "file://" and "http://" both in xsl:import.
    Here's the import lines:
    <xsl:import href="file://D:/temp/Xsd/CommonFunctions.xsl"/>
    or
    <xsl:import href="http://www.v-tek.com/xsl/CommonFunctions.xsl"/>
    I am not sure what causes this error. I tested this in xmlspy and it works well.

    Hi Justin,
    I tried to reproduce your complaint, but wasnt able to. I didnt have a 10104 db to test against though, but I did test against 10105, and 10202, using the following dumb table:
    create table constr_test ( c1 number);
    alter table constr_test add constraint const_1 check (c1 in (1,2,null));
    insert into constr_test values (3);
    commit;
    Frequently a 3113 is the result of an ora-600 or ora-7445 on the database. The fact that it doesnt occur for you on 10.2 db leads me to believe that might be the case here. Have you checked your alert logs?
    Cheers,
    Greg

  • Opening 2 projects causes end of FCP session.

    I would like to use my 6 TB archive project to import files into another project via browser in FCP into timeline. Working on a new project, deciding to open the archive project causes messages as: *out of memory* and *handler error*, that´s the end of session.
    Starting the big archive project first will work fine. WHY ???
    I am asking because it is very uncomfortable starting the big archive project each time, not knowing wether I need it or not, cause it takes 9 minutes to start it.
    Thanks for trying to understand my problem.
    gerolini

    That is a very large project file. Keep in mind that for FCP to be fast and responsive, it must load all the media, every transition and filter and all the sequences into active RAM. I would guess that you've pushed the application to its limit.
    Is there any reason for this huge project? Could you break it down into sub-projects? Throw away old and outdated sequences and render files?
    If I was in your lederhosen, I'd copy the file a number of times, in a way that made sense to you. Then, in each copy, get rid of things that do not pertain to your chosen "subject." For example, I'd name one sub-project Munich and delete everything that has no relation to Munich. And another "Trip to Brazil" and in that one delete Munich and everything else not related to Brazil.
    Does that make sense? It might seem like a good idea to put EVERYTHING in one project file for ease of access, etc-- but if you've pushed the software to the limit, you are gaining exactly nothing.
    Good luck.

  • GREP remove white space at start and end of paragraph

    Hi,
    Question for the GREP experts: I'd like to construct a GREP expression
    that will remove all white space at the start AND end of a paragraph in
    one go.
    What I've got so far works, but you have to run it twice to work:
    I'll try and post it at the bottom of this message, but since I'm
    posting via email it probably will come out scrambled, so I'll describe
    what I've got so far:
    Two expressions in parenthesis separated by the OR character (pipe). The
    first expression searches for one or more space, tab or white-space at
    the beginning of a paragraph.
    The second expression searches for the same at the end of the paragraph.
    Each expression is in parenthesis, and the two groups are separated, as
    I say, by an OR sign.
    However, this has to be run twice for it to work. For it removes all the
    spaces at the start of paragraphs, then when run again all the spaces at
    the end.
    Any ideas how to get it to work in one go?
    Thanks,
    Ariel
    The expression is:
    (^[ \ts]+)|([ \ts)+$)

    Arïel, your GREP appears a bit mashed up in the forum -- was it something like this?
    (^[\t\s]+)|([\t\s]+$)
    If so:
    1. "\s" is "any whitespace", so you would not need to include "\t" as well. But I would not recommend this, as a HUGE disadvantage of "\s" is it also includes hard and soft returns: double returns are seen as "any whitespace" (the first return) and then "end of line" (the second return), and the first is removed. ("Disadvantage" is subject to what you want to accomplish, by the way. I usually don't want this so I list each possible whitespace character that may be removed.)
    2. The parentheses around each 'section' of this GREP are not necessary. The OR operator is 'highest level' -- in this case, since you have an entire left part OR an entire right part, you can omit all parentheses.
    3. This works for me ...
    ^[\t ]+|[\t ]+$
    ... and despite Peter's not-too-shabby suggestion, I would still recommend using mine instead. It's easier on ID (since it only has to remove text, not "remove-and-then-insert-again" (which is exactly what using the $.. operators do), and, more importantly, there are limits to what $1 can 'pick up'. I can't recall the special circumstances, but I have had text attributes shift, and footnotes and anchored objects disappear/being mucked up/otherwise mangled.

  • Unwanted paragraph tag after text inset

    9.0p255 on XP ...  Just searched the forum for a reminder, as it's not every day I need to work with insets. A couple of posts towards the top of a long thread gave the tip of leaving a special space between the anchor for the inset and the end-of-paragraph marker; "ah, that sounds familiar!" I thought, and tried it.  Well, it may sound familiar ... but it doesn't work. Yes, I've already tried a special paragraph style with space above and below set to -2; no luck there either. All the more annoying since I'm fairly sure I did manage to do it in another file-set/on another PC last year.  Thanks in advance for any tips!

    Niels -
    I am stuck in Frame 7.0p577 on Mac (having not yet invested in emulators etc.), so what I say here may not apply to Frame 9 on Windows – but it probably does. I am very familiar with the iceberg of an issue whose tip you have encountered. As I see it, here's what's up:
    When Frame imports a text inset, it takes the end-of-flow and turns it into an end-of-paragraph (displayed with ¶ at its end, assuming you have Display Text Symbols turned on in View Options). Provided that the inset is followed by another paragraph, then all is well. However, the creation of this extra paragraph is insidious in cases where the inset lies at the end of a flow.
    First, if the inset ends a document, an extra line results; that extra line is troublesome if it pushes over a page boundary. The workaround is to increase the height of the page frame, to make room for the line without spilling onto a new page, but that's messy because the manual height adjustment needs to be adjusted again if subsequent editing changes the placement of the extra line.
    Second, it seems that the extra paragraph takes the paragraph tag – and therefore, the paragraph formatting – of the FIRST paragraph in the inset. If the first paragraph of the inset's source flow has an autonumber, then the stray paragraph after the inset will appear with ANOTHER autonumber of that style.
    Third, if an inset is placed in a table cell, the extra line causes the height of that cell to increase. In the common case that the cell then exceeds the height of other cells in the row, the height of the entire row will increase, leaving undesired space. Workarounds such as manually limiting row height are a pain.
    Fourth, if the inset is placed in a footnote, the extra line causes the footnote height of that cell to increase, leaving unwanted space between footnotes of at the bottom of the page.
    Over the years I have adopted the following technique: At the front of flows liable to be used as inset sources, I have an empty paragraph tagged BOF. I set the BOF format in both the source document and the host document to Run-In. Any autonumbering in the first functional paragraph of the source will then be prevented from being carried into the referring document. You might think that a comparable paragraph at the end of the inset source – EOF, maybe – would defeat the insidious behaviour that I describe, but too much of this and things start to fail.
    I have one or two additional ideas in case anyone who made it this far wishes to contact me directly. In fact I'd be delighted for anyone who understands any of the above to contact me!
    I would be delighted if someone at Adobe would follow-up on this, but honestly don’t expect too much.
    - Charles,
    www dot Poynton dot com

  • Grep Removing Characters when searching for Paragraph returns

    I'm currently working on an xml based business card file and the formatting requires me to search for a phone number followed by a End of Paragraph followed by a Page Break and then remove the unnecessary Paragraph Return. For some reason inDesign will not find an End of Paragraph then a Page Break through the following grep code "\r~P", however if I search for "\r\r" it will find it. I have been able to get this to work with "(\d{3}\.\d{3}.\d{4})\r\r" and then change to "$1~P", but each subsequent business card loses one number off of the end (804.777.7777, 804.777.777, 804.777.77 etc). What would cause this?
    Thank you,
    Brandon Boswell

    You should move this over to scripting (http://forums.adobe.com/community/indesign/indesign_scripting). You'll find people over there who can give you more help, if there is any.

Maybe you are looking for