Bug 170306 - DOCX import adds spacing to inline images
Summary: DOCX import adds spacing to inline images
Status: NEEDINFO
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
24.2.7.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-12 11:16 UTC by bugs
Modified: 2026-01-13 03:52 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Archive of a more comprehensive test. (114.99 KB, application/zip)
2026-01-12 11:23 UTC, bugs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bugs 2026-01-12 11:16:06 UTC
Description:
DOCX importing adds spacing to inline images when the DOCX is created by Pandoc.

I tested this with LibreOffice 25.8.4.2 and 24.2.7.2, plus Office 365.

I won't mind if someone can whip up a macro that removes the spacing around all inline images.  I'm going to need it as I'm battling issues with ePubs and various eReaders not rendering fonts and glyphs properly.


Steps to Reproduce:
1. Have the following:
   * Pandoc (Yes, I know you can natively open Markdown but bear with me because I use an odd flavor and I do some conversion before hitting Pandoc)
   * Two SVG files, start.svg and end.svg (I've tested against multiple versions)
2. Create a Markdown file with this content:

```
![Begin] Test line ![End]
    
[Begin]: start.svg {height=12pt}
[End]: end.svg {height=12pt}
```

3. Convert the Markdown file into a DOCX via Pandoc:

```
pandoc test.md -f markdown+bracketed_spans+backtick_code_blocks+fenced_divs+link_attributes+implicit_figures -t docx -o text.docx
```

4. Open the resulting file in LibreOffice
5. Inspect the inline images.

Actual Results:
In LibreOffice, they have a spacing of .13" left and right.  *This is not correct!*

Expected Results:
In Office 365, they have *no* spacing.  *This is correct!*


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.8.4.2 (X86_64) / LibreOffice Community
Build ID: 580(Build:2)
CPU threads: 16; OS: Linux 6.14; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 4:25.8.4~rc2-0ubuntu0.24.04.1~lo1
Calc: threaded

Build from the libreoffice PPA.
Comment 1 bugs 2026-01-12 11:23:24 UTC
Created attachment 205013 [details]
Archive of a more comprehensive test.

This is what I'm using to test.  May need to adjust the Markdown for file paths.
Comment 2 m_a_riosv 2026-01-13 03:52:48 UTC
Do you have the font installed, I see it in italic on the font name box.