Skip to content

Commit

Permalink
Merge pull request #96 from armstrong-pv/bugfix-special-html-char-enc…
Browse files Browse the repository at this point in the history
…oding

HTML decode attachment paths
Fix #80 and #90
  • Loading branch information
alxnbl committed Dec 9, 2023
2 parents 7e0a1e5 + a6eeb63 commit c3e2cff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/OneNoteMdExporter/Services/Export/ExportServiceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Threading;
using System.Net;
using System.Text.Encodings.Web;

namespace alxnbl.OneNoteMdExporter.Services.Export
{
Expand Down Expand Up @@ -320,7 +322,7 @@ public void ExtractImagesToResourceFolder(Page page, ref string mdFileContent)
Match imgMatch = matchs[0];

var panDocHtmlImgTagPath = Path.GetFullPath(imgMatch.Groups["src"].Value);

panDocHtmlImgTagPath = WebUtility.HtmlDecode(panDocHtmlImgTagPath);
Attachement imgAttach = page.ImageAttachements.Where(img => PathExtensions.PathEquals(img.ActualSourceFilePath, panDocHtmlImgTagPath)).FirstOrDefault();

// Only add a new attachment if this is the first time the image is referenced in the page
Expand Down

0 comments on commit c3e2cff

Please sign in to comment.