I have a macOS application that allows the user to select markdown files thru NSOpenPanel.
let mdUrl = openPanel.urls.first! let baseUrl = mdUrl.deletingLastPathComponent() let md = try! String(contentsOf: mdUrl) let html = try! Down(markdownString: md).toHTML() webView.loadHTMLString(html, baseURL: baseUrl) The problem is that the images located in a Images-folder at the same level as the selected md-file are not beeing loaded. Here is an example of the html-beeing loaded by the webView:
<!DOCTYPE html> <html> <body> <p><img src="Images/Exampleimage.png" alt="" /></p> </body> </html> The baseUrl contains an Images-directory with the specified image. What should I do to get the images to load and display properly?