Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -270,44 +270,46 @@ protected override void RenderQuote(QuoteBlock element, IRenderContext context)
else if (firstInline is TextRunInline textRunInline)
{
var key = textRunInline.Text.Split(' ').FirstOrDefault();
if (styles.TryGetValue(key, out var style) && !style.Ignore)
if (styles.TryGetValue(key, out var style))
{
noteType = style;
header = style.IdentifierReplacement;
symbolGlyph = style.Glyph;
if (!style.Ignore)
{
noteType = style;
header = style.IdentifierReplacement;
symbolGlyph = style.Glyph;

// Removes the identifier from the text
textRunInline.Text = textRunInline.Text.Replace(key, string.Empty);
// Removes the identifier from the text
textRunInline.Text = textRunInline.Text.Replace(key, string.Empty);

if (theme == ElementTheme.Light)
{
localForeground = style.LightForeground;
localBackground = style.LightBackground;
}
else
{
localForeground = new SolidColorBrush(Colors.White);
localBackground = style.DarkBackground;
}
if (theme == ElementTheme.Light)
{
localForeground = style.LightForeground;
localBackground = style.LightBackground;
}
else
{
localForeground = new SolidColorBrush(Colors.White);
localBackground = style.DarkBackground;
}

// Apply special formatting context.
if (noteType != null)
{
if (localContext?.Clone() is UIElementCollectionRenderContext newContext)
// Apply special formatting context.
if (noteType != null)
{
localContext = newContext;
if (localContext?.Clone() is UIElementCollectionRenderContext newContext)
{
localContext = newContext;

localContext.TrimLeadingWhitespace = true;
QuoteForeground = Foreground;
LinkForeground = localForeground;
localContext.TrimLeadingWhitespace = true;
QuoteForeground = Foreground;
LinkForeground = localForeground;
}
}
}
}

if (style.Ignore)
{
// Blank entire block
textRunInline.Text = string.Empty;
else
{
// Blank entire block
textRunInline.Text = string.Empty;
}
}
}
}
Expand Down