-
Notifications
You must be signed in to change notification settings - Fork 76
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
base: master
Are you sure you want to change the base?
Conversation
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. |
@@ -182,6 +184,10 @@ + (instancetype)standardParser { | |||
[attributedString addAttributes:weakParser.emphasisAttributes range:range]; | |||
}]; | |||
|
|||
[defaultParser addStrongAndEmphasisParsingWithFormattingBlock:^(NSMutableAttributedString *attributedString, NSRange range) { |
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 may move this line before Strong and Emphasis.
TSMarkdownParser/TSMarkdownParser.m
Outdated
@@ -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] }; |
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.
not building on macOS target or iOS 6
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. |
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.
needs to keep compatibility with macOS target
332b9bb
to
05f162e
Compare
0abcbb1
to
f5080a5
Compare
No description provided.