Skip to content

Method .InsertParagraphAfterSelf(paragraph) does not move FollowingTables to a new paragraph #481

Description

@SheinEA

Hi, I have found a problem that when I add a paragraph using the .InsertParagraphAfterSelf(paragraph) method, FollowingTables are not wrapped into the new paragraph.
Example:
image
If I start copying the first paragraph 1. One, it will be copied without the table. Which is why I have to write something like this:

      public static Paragraph InsertParagraphAfterSelfWithTables(this Paragraph self, Paragraph paragraph)
        {
            var newParagraph = self.InsertParagraphAfterSelf(paragraph);

            if ((paragraph.FollowingTables?.Count ?? 0) > 0 && 
                (newParagraph.FollowingTables?.Count ?? 0) == 0)
            {
                foreach (var table in paragraph.FollowingTables!)
                {
                    newParagraph.InsertTableAfterSelf(table);
                }
            }

            return newParagraph;
        }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions