Skip to content

Auto move image folder does not work with ./assets/${filename} #6619

Description

@mekrina

Description

Typora's Auto move image folder works when the custom image folder is configured as:

${filename}.assets

For example, renaming foo.md to bar.md also renames foo.assets/ to bar.assets/ and updates the image references.

However, the same behavior does not work when ${filename} is a subdirectory of a shared assets folder:

./assets/${filename}

Steps to reproduce

  1. Open Preferences → Image.

  2. Set Copy image to custom folder to:

    ./assets/${filename}
    
  3. Create this structure:

    foo.md
    assets/
      foo/
        image.png
    
  4. Add this image reference to foo.md:

    ![](./assets/foo/image.png)
  5. Rename foo.md to bar.md using Typora's file-tree sidebar.

Actual behavior

The Markdown file is renamed, but:

  • assets/foo/ is not renamed.
  • Typora does not prompt to move the image folder.
  • The image reference is not updated.

Expected behavior

Because the configured image path contains ${filename}, Typora should offer to:

foo.md       → bar.md
assets/foo/  → assets/bar/

and update the reference to:

![](./assets/bar/image.png)

Comparison

Using ${filename}.assets works as expected, while ./assets/${filename} does not.

Could Typora support filename-linked image directories nested inside a shared assets directory, or document this limitation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions