Skip to content

Commit

Permalink
fixes #602
Browse files Browse the repository at this point in the history
  • Loading branch information
ebicoglu committed Dec 11, 2018
1 parent bb2e740 commit 0d6a790
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class MarkdownDocumentToHtmlConverter : IDocumentToHtmlConverter, ITransi
public const string Type = "md";

private const string MdLinkFormat = "[{0}](/documents/{1}/{2}{3}/{4})";
private const string MarkdownLinkRegExp = @"\[([^)]+)\]\(([^)]+." + Type + @")\)";
private const string MarkdownLinkRegExp = @"\[(.*)\]\((.*\.md)\)";
private const string AnchorLinkRegExp = @"<a[^>]+href=\""(.*?)\""[^>]*>(.*)?</a>";

public virtual string Convert(ProjectDto project, DocumentWithDetailsDto document, string version)
Expand All @@ -36,12 +36,12 @@ public virtual string Convert(ProjectDto project, DocumentWithDetailsDto documen
}

protected virtual string NormalizeLinks(
string content,
string projectShortName,
string content,
string projectShortName,
string version,
string documentLocalDirectory)
{
var normalized = Regex.Replace(content, MarkdownLinkRegExp, delegate(Match match)
var normalized = Regex.Replace(content, MarkdownLinkRegExp, delegate (Match match)
{
var link = match.Groups[2].Value;
if (UrlHelper.IsExternalLink(link))
Expand Down

0 comments on commit 0d6a790

Please sign in to comment.