Skip to content

Commit 87b19f5

Browse files
Added support for emoji and smiley extension. Currently only monochrome emojis are supported.
1 parent 56db06c commit 87b19f5

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

DotNetElements.Wpf.Markdown.Example/MainWindow.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ This is a [Link](http://a.com)
7474
7575
This is a auto generated mailto link mailto:[email protected]
7676
77+
We all need :), it makes us :muscle:. (and :ok_hand:).
78+
7779
---
7880
7981
Nested style test

DotNetElements.Wpf.Markdown.Tests/DocumentMarkdownWriterSnapshotTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public async Task RendersMarkdownCorrectly()
2525
.UsePipeTables()
2626
.UseAlertBlocks()
2727
.UseAutoLinks()
28+
.UseEmojiAndSmiley()
2829
.Build();
2930

3031
pipeline.Setup(renderer);

DotNetElements.Wpf.Markdown/MarkdownConfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public sealed record MarkdownConfig
88
public IImageProvider? ImageProvider { get; set; }
99
public string LocalImagePath { get; set; } = "img";
1010
public bool FeatureEmphasisExtrasSupported { get; set; } = true; // todo use subclass like MarkdownThemes or enum flags for features
11+
public bool FeatureEmojiAndSmileySupported { get; set; } = true; // todo use subclass like MarkdownThemes or enum flags for features
1112
public bool FeatureImageSizeSupported { get; set; } = true; // todo use subclass like MarkdownThemes or enum flags for features
1213
public bool FeatureTaskListSupported { get; set; } = true; // todo use subclass like MarkdownThemes or enum flags for features
1314
public bool FeaturePipeTablesSupported { get; set; } = true; // todo use subclass like MarkdownThemes or enum flags for features

DotNetElements.Wpf.Markdown/MarkdownTextBlock.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ private static MarkdownPipeline BuildPipeline(MarkdownConfig config)
214214
if (config.FeatureEmphasisExtrasSupported)
215215
pipelineBuilder.UseEmphasisExtras();
216216

217+
if (config.FeatureEmojiAndSmileySupported)
218+
pipelineBuilder.UseEmojiAndSmiley();
219+
217220
if (config.FeatureTaskListSupported)
218221
pipelineBuilder.UseTaskLists();
219222

0 commit comments

Comments
 (0)