-
Notifications
You must be signed in to change notification settings - Fork 61
Support for emphasis extensions #11
Conversation
… through, inserted, and marked)
|
@thoemmi is there anything you can't do? 😆 😆 😆 |
|
@amkuchta I'm only sharpening my saw 😉 |
…far as I can see)
|
Thanks. I'll have a look later this week (sorry, quite busy at the moment). |
Kryptos-FR
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few remarks, nothing critical. I'll merge once the requested changes are done.
Thanks again for the contribution.
| .UsePipeTables() | ||
| .UseTaskLists(); | ||
| .UseTaskLists() | ||
| .UseEmphasisExtras(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember if the order matters. I think it does sometimes, so maybe it would be better to follow the same order than https://github.com/lunet-io/markdig/blob/master/src/Markdig/MarkdownExtensions.cs#L59
Note that the order is already different so not a big deal at the moment.
| renderer.Write("<").Write(tag); | ||
| switch (obj.DelimiterChar) | ||
| { | ||
| case '~': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for the sake of completeness, add the cases for '*' and '~' that immediately break. It keeps balance with the previous method and shows that those two options are valid.
| /// Resource Key for the ThematicBreakStyle. | ||
| /// </summary> | ||
| public static ComponentResourceKey ThematicBreakStyleKey { get; } = new ComponentResourceKey(typeof(Styles), nameof(ThematicBreakStyleKey)); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point I should extract the ones that come with an extension into a separate class (maybe one class per extension). For the moment I prefer to have those sorted in alphabetical order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't notice the alphabetic ordering of style keys 😆
src/Markdig.Wpf/Styles.cs
Outdated
| public static ComponentResourceKey SubscriptStyleKey { get; } = new ComponentResourceKey(typeof(Styles), nameof(SubscriptStyleKey)); | ||
|
|
||
| /// <summary> | ||
| /// Resource Key for the SubscriptStyle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy/paste mistake
src/Markdig.Wpf/Styles.cs
Outdated
| public static ComponentResourceKey StrikeThroughStyleKey { get; } = new ComponentResourceKey(typeof(Styles), nameof(StrikeThroughStyleKey)); | ||
|
|
||
| /// <summary> | ||
| /// Resource Key for the InsertedStyleKeyStyle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy/paste mistake
src/Markdig.Wpf/Styles.cs
Outdated
| public static ComponentResourceKey InsertedStyleKey { get; } = new ComponentResourceKey(typeof(Styles), nameof(InsertedStyleKey)); | ||
|
|
||
| /// <summary> | ||
| /// Resource Key for the MarkedStyleKeyStyle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy/paste mistake
explicit cases for bold/italic in EmphasisInlineRenderer for XAML ordered extensions like original Markdig
|
I think I've addressed all of your concerns. |
This PR adds support for emphasis extensions (subscript, superscript, strike through, inserted, and marked)
to both WPF and XAML rendering. All of them can be customized with styles.
This also fixes part of @amkuchta in #10.