Markdown Image Path Repair

Write Markdown image destinations that contain spaces

A bare Markdown destination normally stops at the first space. Surround the destination with angle brackets when the image filename includes a space and the Markdown display treats the whole expression as text.

Open Markdown Image Path Repair

Keep a survey photo and its title

Input

![Landscape](./photos/river bend.jpg "South bank")

Output

![Landscape](<./photos/river bend.jpg> "South bank")

The brackets surround only the image path. Keep the optional title after the closing angle bracket. The renderer can now read the full filename as one destination.

Check the result

  1. Save the export near the source Markdown file so relative paths still point to the same directories.
  2. Load the repaired Markdown in the renderer your readers use and check that the image appears.
  3. If an image still points to an empty location, check whether the file is available at the same path, including its capitalization.

Common problems

Keep optional titles outside the angle brackets

The title belongs after the path within the surrounding parentheses. Its spaces are separate from spaces in the path.

Use the same document location for relative paths

A path starting with two dots points one directory up from where the Markdown is rendered. Moving the file changes that starting point.

Check the scope of the scan

This repair covers inline images with common file extensions and a path on one line. Reference definitions, HTML and custom wiki embeds use different syntax.

Using Markdown Image Path Repair

Open Markdown

Choose the document that shows broken images or literal Markdown syntax.

Review the changed lines

Check that the tool picked out the complete path to the image.

Export and preview

Open the repaired file in the same project directory and preview it where readers will see it.

Offline use

Open the tool once online and let it finish loading. Use the install option in your browser or Add to Home Screen on iPhone. Reopen the tool to process a new input offline.

References