mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-08-14 06:23:02 -06:00
Embed URLs never pass through the markdown parser, so the regex change in #1568 did not cover them and a javascript: URL in embed.url or embed.author.url still reached a live href. Adds ExportContext.EnsureSafeUrl, which returns the URL only when it parses as an absolute http or https URI, and applies it at the four embed anchors. An unsafe URL now takes the existing else branch, so the title and author text still render, just without a link. HtmlMarkdownVisitor.VisitLinkAsync uses the same helper and renders the link children without an anchor when the scheme is not allowed, so the three link regexes in MarkdownParser are no longer the only thing keeping unsafe schemes out of the export. |
||
|---|---|---|
| .. | ||
| Discord | ||
| Exceptions | ||
| Exporting | ||
| Markdown | ||
| Utils | ||
| DiscordChatExporter.Core.csproj | ||