You converted a page from HTML to Markdown, opened the result, and the links are wrong. A button lost its link, an image points at a file that is not there, a path that worked for years leads nowhere. The natural suspect is the converter. It is usually innocent.

The HTML to Markdown Converter on Ovatly turns pasted HTML into Markdown with the Turndown library, and a clean link in HTML comes out as a clean link in Markdown, same text, same URL. The mangling happens on the input side: URLs that only made sense on the old site, image files that never travelled with the text, and link shapes Markdown has no syntax for. Four mistakes cause nearly all of it.

Contents

  • Quick answer
  • A clean link converts cleanly
  • Mistake 1: relative URLs that break in the new home
  • Mistake 2: image links whose files never moved
  • Mistake 3: buttons and linked blocks
  • Mistake 4: empty anchor text
  • How to convert without mangling links, step by step
  • Worked example: one fragment, three URLs, checked one by one
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion
  • References

Quick answer

If your links broke in conversion, check four things before blaming the tool: relative URLs that pointed at the old site's folders, images that became image syntax while the files stayed behind, buttons and linked blocks that Markdown cannot express and so simplified, and links with empty anchor text. Convert with the HTML to Markdown Converter, then audit the output link by link.

The converter is a translator, not an editor. A link written as an a element with an href and text comes out in Markdown link syntax, [text](url), with both parts untouched. The worked example near the end of this guide shows it directly: a heading, emphasis and a link go in as HTML and come out as an ATX heading, underscore emphasis and the same link, word for word. So when a page converts with broken links, the breakage was already in the HTML, or in the move that followed.

Mistake 1: relative URLs that break in the new home

A relative URL such as /process or ../images/chart.png has no fixed meaning. It resolves against wherever the file happens to live. On the old site it pointed at a real page. Move the Markdown into a documentation repo or a new CMS and the same text resolves against a different folder tree, where that page may not exist.

The converter kept the URL character for character. What changed is the home. The check: search the output for links starting with a slash or with dots, and decide each one on purpose: rewrite it to the target's new location, or make it a full absolute URL.

An img element becomes Markdown image syntax with its source and alt text, like ![alt](/photo.jpg). That is all it becomes. The image file itself is not downloaded or carried along, and the same applies to a linked image.

The check is mechanical: list every image reference in the output, and confirm a real file exists at that path in the new home. If not, copy the file across or rewrite the path, and count this as part of the conversion, not an afterthought.

Mistake 3: buttons and linked blocks

HTML lets a link wrap almost anything: a heading, a whole card, a styled button built from a div and a span. Markdown links are inline only: no syntax for a linked card, and none for a button with classes. Meeting a shape Markdown cannot express, the converter simplifies the element or drops the wrapper, keeping the text where possible.

That is a syntax limit, not corruption. The button usually survives as a plain inline link, minus the styling. The check: find every button and linked block in the original, then confirm a link still wraps the same words in the output.

Mistake 4: empty anchor text

A link needs words to carry it. An a element with no text, or whose only content is an icon or an image with empty alt text, gives Markdown nothing to put between the brackets. The output is an empty link nobody can read or meaningfully click.

Share buttons, icon links and logo links are the usual sources. The check: search the file for empty link brackets and empty alt text, then give those links real words.

  1. Copy the page's HTML, a full page or just the content fragment, and paste it into the HTML to Markdown Converter. Paste HTML, not a URL: the tool never fetches.
  2. Convert, then copy the Markdown or download it as a .md file.
  3. List the URLs in the source (every href and src) and in the output, and compare them. Each should appear unchanged.
  4. Search the output for relative paths and rewrite or absolutize each one for the new home.
  5. For every image reference, copy the actual image file to the path the Markdown expects.
  6. Search for empty link brackets and empty alt text, and give those links real words.

Worked example: one fragment, three URLs, checked one by one

One fragment, three URLs: an inline link, an image and a button.

<h2>Our story</h2>
<p>We make <em>small-batch</em> soap. Read <a href="/process">how it is made</a>.</p>
<p><img src="/photo.jpg" alt="Bars of soap curing on a rack"></p>
<p><a class="button" href="/buy">Buy the soap</a></p>

Converted, it reads:

## Our story

We make _small-batch_ soap. Read [how it is made](/process).

![Bars of soap curing on a rack](/photo.jpg)

[Buy the soap](/buy)

Now the audit. The /process link converted perfectly and is still relative, so it breaks the moment this file leaves the old site: rewrite it. The image became correct syntax, but photo.jpg was not downloaded, so copy the file to that path by hand. The button lost its class, because Markdown has no buttons, but its text and /buy URL survived as a plain link. Three URLs, three fates, none of them a converter error.

Limitations and honest tradeoffs

The converter translates markup; it does not repair it. It will not fetch a URL, download an image, rewrite a relative path or invent link text the HTML never had. Elements Markdown cannot express, such as forms, styled div layouts and complex table layouts, are simplified or dropped, keeping their text where possible, while simple tables become pipe tables. Scripts and styles are not carried into the output at all. Everything happens locally: the pasted HTML is parsed as text in your browser, no script inside it runs, and nothing is uploaded, which is why the fetching and fixing steps stay yours to run.

Common mistakes

  • Pasting a URL and expecting a fetch. The tool converts pasted HTML only. Copy the page source, not the address.
  • Converting the whole page, navigation included. Menus and footers convert too. Paste the content fragment.
  • Moving the .md file alone and calling it done. Images and relative link targets live outside the file. Move them, or rewrite the paths.
  • Reporting a simplified button as a bug. It is a syntax limit, not a malfunction.

FAQs

Does the converter change or shorten my link URLs? No. A clean link in the HTML comes out with the same URL in Markdown link syntax. When a link breaks after conversion, the cause is almost always the URL itself: a relative path from the old site, or a target file never moved.

Why did my image vanish after I converted the page? It did not vanish; it became image syntax with the original source path and alt text. The converter emits syntax only and does not download the file, so you have to copy the file to the matching path yourself.

Why did my button turn into a plain link? Markdown has no button syntax and no way to wrap a link around a styled block. Linked blocks and buttons are simplified during conversion, keeping their text where possible, so a button survives as an ordinary inline link without its styling.

Can I paste a page URL and let the tool fetch it? No. The converter works on HTML you paste, a full page or a fragment. It never fetches a URL, and the pasted HTML is parsed as text in your browser, so no script in it runs.

How do I check the converted links quickly? List the URLs in the source HTML and in the Markdown output, and compare them one by one. Then search the output for relative paths, image syntax whose files you have not copied, and empty link brackets.

Conclusion

Links rarely break inside the converter; they break in the gap between what the HTML assumed and where the Markdown ends up. Convert, then audit: URLs compared, paths decided, files moved, empty links given words. Moving a whole set of documentation rather than rescuing one page? Our guide to migrating documentation from HTML to Markdown lays out the page-by-page process. More guides in this series live in our Website and Webmaster Tools guides.

References