diff --git a/samples/Indiko.Maui.Controls.Markdown.Sample/Indiko.Maui.Controls.Markdown.Sample.csproj b/samples/Indiko.Maui.Controls.Markdown.Sample/Indiko.Maui.Controls.Markdown.Sample.csproj index 0038a21..6efb5f7 100644 --- a/samples/Indiko.Maui.Controls.Markdown.Sample/Indiko.Maui.Controls.Markdown.Sample.csproj +++ b/samples/Indiko.Maui.Controls.Markdown.Sample/Indiko.Maui.Controls.Markdown.Sample.csproj @@ -60,8 +60,8 @@ - - + + diff --git a/src/Indiko.Maui.Controls.Markdown/Indiko.Maui.Controls.Markdown.csproj b/src/Indiko.Maui.Controls.Markdown/Indiko.Maui.Controls.Markdown.csproj index 2ea86ce..63dae92 100644 --- a/src/Indiko.Maui.Controls.Markdown/Indiko.Maui.Controls.Markdown.csproj +++ b/src/Indiko.Maui.Controls.Markdown/Indiko.Maui.Controls.Markdown.csproj @@ -39,8 +39,8 @@ - - + + diff --git a/src/Indiko.Maui.Controls.Markdown/MarkdownView.cs b/src/Indiko.Maui.Controls.Markdown/MarkdownView.cs index 8850cf8..2a3b5f9 100644 --- a/src/Indiko.Maui.Controls.Markdown/MarkdownView.cs +++ b/src/Indiko.Maui.Controls.Markdown/MarkdownView.cs @@ -692,7 +692,7 @@ private FormattedString CreateFormattedString(string line, Color textColor) { var formattedString = new FormattedString(); - var parts = Regex.Split(line, @"(\*\*.*?\*\*|__.*?__|_.*?_|`.*?`|\[.*?\]\(.*?\))"); + var parts = Regex.Split(line, @"(\*\*.*?\*\*|__.*?__|_.*?_|`.*?`|\[.*?\]\(.*?\)|\*.*?\*)"); foreach (var part in parts) { @@ -726,6 +726,13 @@ private FormattedString CreateFormattedString(string line, Color textColor) span.TextColor = textColor; span.FontFamily = TextFontFace; } + else if (part.StartsWith('*') && part.EndsWith('*')) + { + span.Text = part.Trim('*', ' '); + span.FontAttributes = FontAttributes.Italic; + span.TextColor = textColor; + span.FontFamily = TextFontFace; + } else if (part.StartsWith('[') && part.Contains("](")) // Link detection { var linkText = part[1..part.IndexOf(']')]; @@ -755,6 +762,7 @@ private FormattedString CreateFormattedString(string line, Color textColor) return formattedString; } + private void AddBulletPointToGrid(Grid grid, int gridRow) { string bulletPointSign = "-";