| @@ -70,18 +70,10 @@ namespace MarkdownDeep | |||||
| if (index >= 0) | if (index >= 0) | ||||
| { | { | ||||
| Uri uri; | Uri uri; | ||||
| if (Uri.TryCreate(url, UriKind.RelativeOrAbsolute, out uri)) | |||||
| { | |||||
| if (!uri.IsAbsoluteUri) | |||||
| { | |||||
| // TODO: Check if link exists in the ToC | |||||
| var existsInTableOfContents = true; | |||||
| if (existsInTableOfContents) | |||||
| { | |||||
| url = url.Remove(index, ".md".Length).Insert(index, ".htm"); | |||||
| } | |||||
| } | |||||
| } | |||||
| if(Uri.TryCreate(url, UriKind.Relative, out uri)) | |||||
| { | |||||
| url = String.Concat(url.Substring(0, index), ".htm", url.Substring(index + ".md".Length)); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| <h1>Markdown</h1> | <h1>Markdown</h1> | ||||
| <p> <a href="https://github.com/FransBouma">Remote link</a> </p> | <p> <a href="https://github.com/FransBouma">Remote link</a> </p> | ||||
| <p> <a href="https://github.com/FransBouma/target1.md">Remote link</a></p> | |||||
| <p> <a href="./target1.htm">Local 1</a> </p> | <p> <a href="./target1.htm">Local 1</a> </p> | ||||
| <p> <a href="./target2.htm#bla">Local 2</a> </p> | <p> <a href="./target2.htm#bla">Local 2</a> </p> | ||||
| @@ -3,6 +3,8 @@ Markdown | |||||
| [Remote link](https://github.com/FransBouma) | [Remote link](https://github.com/FransBouma) | ||||
| [Remote link](https://github.com/FransBouma/target1.md) | |||||
| [Local 1](./target1.md) | [Local 1](./target1.md) | ||||
| [Local 2](./target2.md#bla) | [Local 2](./target2.md#bla) | ||||