Skip to content
This repository was archived by the owner on Mar 14, 2024. It is now read-only.

Conversation

@thoemmi
Copy link
Contributor

@thoemmi thoemmi commented Oct 21, 2017

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.

@amkuchta
Copy link

@thoemmi is there anything you can't do? 😆 😆 😆

@thoemmi
Copy link
Contributor Author

thoemmi commented Oct 21, 2017

@amkuchta I'm only sharpening my saw 😉

@Kryptos-FR
Copy link
Owner

Thanks. I'll have a look later this week (sorry, quite busy at the moment).

@Kryptos-FR Kryptos-FR self-assigned this Oct 23, 2017
Copy link
Owner

@Kryptos-FR Kryptos-FR left a 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();
Copy link
Owner

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 '~':
Copy link
Owner

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));

Copy link
Owner

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.

Copy link
Contributor Author

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 😆

public static ComponentResourceKey SubscriptStyleKey { get; } = new ComponentResourceKey(typeof(Styles), nameof(SubscriptStyleKey));

/// <summary>
/// Resource Key for the SubscriptStyle.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy/paste mistake

public static ComponentResourceKey StrikeThroughStyleKey { get; } = new ComponentResourceKey(typeof(Styles), nameof(StrikeThroughStyleKey));

/// <summary>
/// Resource Key for the InsertedStyleKeyStyle.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy/paste mistake

public static ComponentResourceKey InsertedStyleKey { get; } = new ComponentResourceKey(typeof(Styles), nameof(InsertedStyleKey));

/// <summary>
/// Resource Key for the MarkedStyleKeyStyle.
Copy link
Owner

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
@thoemmi
Copy link
Contributor Author

thoemmi commented Oct 23, 2017

I think I've addressed all of your concerns.

@Kryptos-FR Kryptos-FR changed the base branch from master to develop October 24, 2017 01:53
@Kryptos-FR Kryptos-FR merged commit 012f44f into Kryptos-FR:develop Oct 24, 2017
@thoemmi thoemmi deleted the extra-emphasis branch October 24, 2017 13:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants