Lists Not Displaying Correctly (Misformatted) When Pasting in LibreOffice Writer

When I paste content containing lists, the list dots get slapped with the list items. Here is a screenshot that shows the difference between a list I pasted and a list I made in LibreOffice Writer:

misformatted lists in lo

I paste a lot of content into LibreOffice Writer, so manually creating lists in LO isn’t a possible option for me.

Is there anything I can do so LibreOffice Writer formats the lists correctly?

By the way, I am using 24.2.2.1 on Windows 10.

1 Like

If you paste as unformatted text then you won’t get a list.

For lists, I find it easiest to paste normally and then apply an appropriate paragraph style, e.g. List 1 modified to include a list style, from the styles for the receiving document. Select the pasted text and press Ctrl+M after modifying to remove other possible direct formattings brought over

There is a danger of overwriting styles that exist in potential for your document so it is worth ensuring Headings 1,2 & 3 are in use already before pasting internet content. The attached sample uses List 1 paragraph style which includes My Bullets :black_small_square: list style. I pasted a sample from a government website which included a list
List1Style.odt (17.4 KB)

1 Like

I paste it as formatted text, and I still get the lists looking weird.

Manually adjusting every single list isn’t possible for me as I work with a lot of text.

I pasted another list to the sample document you provided, and still the same issue (I know I have to manually adjust it to List 1):

I just want the list to be correctly formatted after pasting, like Office Word does. Maybe it’s a bug from LibreOffice Writer’s end?

Do you have a sample document of what it has been pasted from?

1 Like

Here is a sample content (not sure if it is considered a document, still the same):

The problem is the same, whether the list is ordered or unordered:

misformatted ordered list

You’re copying from HTML. Pasting this text into Writer needs a filter to translate from HTML to ODF (Writer internal format). Since CSS directives has no direct style counterparts, HTML formatting is converted to direct formatting (DF).

BUT, list information lives in a different layer than bold, italic, colour, … This layer is not affected by Ctl+M. List direct formatting brought in by Format>Bullets & Numbering remains active and DF has higher precedence than styles.

The solution, if you don’t want to manually fix every occurrence (which is a legitimate request) is to create a list style or to customise an unused existing builtin one to configure your preferred layout.

  1. select the list items
  2. use the toolbar button to disable list formatting
  3. apply your custom list style

With a custom list style, the layout can changed globally by playing with list settings. This is not possible if you keep the raw direct formatting resulting from the paste operation.

1 Like

I copy HTML most of the time, but I always use wordhtml.com to remove all CSS classes, tag attributes, etc. So, only the HTML remains.

I thought of using a custom list style, but I had the same problem of selecting every list and assigning the custom style to it.

I want LibreOffice Writer to format the pasted lists (pure HTML, no CSS) correctly like Office Word does, applying the default list formatting is okay for me.

Nope! It has a twisty implementation to try and mimic Word’s behaviour which IMHO is buggy. Word has no notion of styles beyond paragraph. Therefore it uses heuristics which are not strongly rooted on solid abstract concepts. Writer approach is different.

The main problem with Format>Bullets & Numbering is to guess the extent of a list. It works rather correctly when you type initially, but gets awry when you edit in a non sequential order. The result is the creation of independent anonymous list styles which are difficult to control globally.

If you really want a consistent layout, I see no other solution than applying explicitly a list style.

1 Like