Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/DocSharp.Common/Writers/MarkdownStringWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public void WriteHyperlink(string displayText, string target, bool isAnchor, str
else
// Microsoft Word usually escapes spaces in the relationship, but we ensure it here.
target = target.Replace(" ", "%20");
// Escape parentheses to avoid breaking markdown link syntax: [text](url)
target = target.Replace("(", "%28").Replace(")", "%29");

Write($"[{displayText}]({target}");
if (!string.IsNullOrWhiteSpace(tooltip))
Expand Down