Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Strong & Emphasis formatter #68

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

stephanheilner
Copy link

No description provided.

@Coeur Coeur self-assigned this Mar 5, 2018
@Coeur
Copy link
Collaborator

Coeur commented Mar 5, 2018

Thank you @stephanheilner. As DaringFireball is effectively supporting this combination, I'll accept this workaround for branch 2.x.

Note that branch 3.x will work differently, with traits.

@Coeur Coeur added this to the 2.2.0 milestone Mar 5, 2018
@@ -182,6 +184,10 @@ + (instancetype)standardParser {
[attributedString addAttributes:weakParser.emphasisAttributes range:range];
}];

[defaultParser addStrongAndEmphasisParsingWithFormattingBlock:^(NSMutableAttributedString *attributedString, NSRange range) {
Copy link
Collaborator

@Coeur Coeur Mar 5, 2018

Choose a reason for hiding this comment

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

I may move this line before Strong and Emphasis.

@@ -58,6 +58,9 @@ - (instancetype)init {
#else
_emphasisAttributes = @{ NSFontAttributeName: [[NSFontManager sharedFontManager] convertFont:[UIFont systemFontOfSize:defaultSize] toHaveTrait:NSItalicFontMask] };
#endif
_strongAttributes = @{ NSFontAttributeName: [UIFont boldSystemFontOfSize:defaultSize] };

_strongAndEmphasisAttributes = @{ NSFontAttributeName: [UIFont fontWithDescriptor:[[[UIFont systemFontOfSize:defaultSize] fontDescriptor] fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitBold | UIFontDescriptorTraitItalic)] size:defaultSize] };
Copy link
Collaborator

@Coeur Coeur Mar 5, 2018

Choose a reason for hiding this comment

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

not building on macOS target or iOS 6

@Coeur
Copy link
Collaborator

Coeur commented Mar 5, 2018

Ah, well, sadly, it doesn't work for iOS 6 and macOS, so it's better to wait for TSMarkdownParser 3.0, as it will give proper support for it.

Copy link
Collaborator

@Coeur Coeur left a comment

Choose a reason for hiding this comment

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

needs to keep compatibility with macOS target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants