Support of embedded images was recently added but anything above 65520 in character length will not get rendered.
In the ParsedMarkdownDocument.DownloadImages method it is checking Uri.IsWellFormedUriString when getting the set of urls to process. Uri.IsWellFormedUriString calls Uri.TryCreate internally which checks a buffer limit constant of 65520 on string length.
Reproduce:
Add markdown that contains embedded image where the string length of the Url > 65520.
Actual:
A link is rendered in the PDF instead of the embedded image
Expected:
There will be a practical limit based on string length were embedding large images as Base64 isn't a good idea but the 65520 limit is just small enough to cause issues.
Versions:
QuestPDF Version [e.g. 2024.7.2]
QuestPDF.Markdown Version 1.20.1
Suggestion:
Move the Uri.IsWellFormedUriString check to right before httpClient is used to download from the url but after regex that matches data:image. I would submit PR but I don't have permission to the repository to do so.
Large Embedded image doesn't get rendered
Support of embedded images was recently added but anything above 65520 in character length will not get rendered.
In the ParsedMarkdownDocument.DownloadImages method it is checking Uri.IsWellFormedUriString when getting the set of urls to process. Uri.IsWellFormedUriString calls Uri.TryCreate internally which checks a buffer limit constant of 65520 on string length.
Reproduce: Add markdown that contains embedded image where the string length of the Url > 65520.
Actual: A link is rendered in the PDF instead of the embedded image
Expected: There will be a practical limit based on string length were embedding large images as Base64 isn't a good idea but the 65520 limit is just small enough to cause issues.
Versions:
Suggestion: Move the Uri.IsWellFormedUriString check to right before httpClient is used to download from the url but after regex that matches data:image. I would submit PR but I don't have permission to the repository to do so.