dotnet / dotnet/eShopSupport

PDF Generation for Products with Special Characters in Brand Names

Open
#46 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
658
Forks
189
PR merge metrics
No merged PRs in 30d

Description

I encountered an issue while generating PDFs where some product brand names include special characters like &. To temporarily resolve this, I used .Replace("&", "**& ;**") in the [FooterHtml property of Markdown2PdfOptions](https://github.com/dotnet/eShopSupport/blob/main/seeddata/DataGenerator/Generators/ManualPdfConverter.cs#L35).

For a permanent fix, we can:

Update the Prompt: Adjust the product generation prompt to avoid names with special characters.
Use WebUtility.HtmlEncode: Automatically escape special characters (e.g., &, <, >) using WebUtility.HtmlEncode to handle them correctly in XML/HTML contexts.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.