-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MarkdownTextBlock doesn't support backticks in Link Text #2802
Comments
As mentioned in #2806 to @michael-hawker for the related issue, I can confirm that this too can be fixed (at least as a quick workaround) by replacing this line: https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/a722f171cac7959d8fb39d732c5951018a2e8c07/Microsoft.Toolkit.Uwp.UI.Controls/MarkdownTextBlock/Render/MarkdownRenderer.Inlines.cs#L581 With this code: try
{
localContext.InlineCollection.Add(inlineUIContainer);
}
catch (ArgumentException)
{
// Fallback span
Run run = new Run
{
Text = text.Text,
FontFamily = InlineCodeFontFamily ?? FontFamily,
Foreground = InlineCodeForeground ?? Foreground
};
// Additional formatting
if (localContext.WithinItalics) run.FontStyle = FontStyle.Italic;
if (localContext.WithinBold) run.FontWeight = FontWeights.Bold;
// Add the fallback block
localContext.InlineCollection.Add(run);
} This will still render the code with the usual code font/foreground, and will just lack the additional background color (as it's just a |
This issue seems inactive. It will automatically be closed in 14 days if there is no activity. |
Micrsoft does advise against formatting text in a link, though... |
I'm submitting a...
Current behavior
Trying to render the following valid markdown doesn't work:
Expected behavior
Windows.UI.Composition
APIsMinimal reproduction of the problem with instructions
Exception thrown in last line of RenderCodeRun trying to add inline to collection -
System.ArgumentException: 'Value does not fall within the expected range.'
Environment
The text was updated successfully, but these errors were encountered: