Bug 168446 - Writer markdown import: better representation of image description & title
Summary: Writer markdown import: better representation of image description & title
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Ujjawal Kumar
URL:
Whiteboard: target:26.2.0
Keywords:
Depends on:
Blocks: Markdown
  Show dependency treegraph
 
Reported: 2025-09-17 11:42 UTC by Miklos Vajna
Modified: 2025-09-19 10:41 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miklos Vajna 2025-09-17 11:42:33 UTC
https://spec.commonmark.org/0.31.2/#images says when you have a markup like

![foo](/url "title")

then "foo" is an image *description* and "title" is a title, both of them are optional. Writer also has a concept of image "names", though those have to be unique.

Steps to reproduce the problem:

1) Open a test.md file with the "A ![mydesc](./test.png "mytitle") Z" in it twice.

2) Check the resulting image name, description & title.

Expected results:

1) Image name has to be unique, so something auto-generated (by Writer) like Image1 & Image2 is fine.

2) md description is to be stored using SwFlyFrameFormat::SetObjDescription()

3) md title is to be stored using SwFlyFrameFormat::SetObjTitle()

Actual results:

1) Name is filled in using the md title. The md import tries to give the same name to two fly formats currently, but that won't survive e.g. ODT export + import as the importer enforces unique names.

2) Description is empty

3) Title is filled in using the md description.
Comment 1 Miklos Vajna 2025-09-17 11:43:37 UTC
CC Ujjawal; I intend to get to this later this week, but wanted to flag this early in case you see anything problematic with this. Thanks.
Comment 2 Commit Notification 2025-09-18 06:50:10 UTC
Ujjawal Kumar committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/412c0391b56419bea6b0ff7c949ef2ced59a4d6b

tdf#168446 Unique name for images and better image representation

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2025-09-19 10:35:57 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3a294f97a9b37cc8ff38f76200b5b58879a3a72f

tdf#168446 sw markdown export: improve image name/description/title handling

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.