-
Notifications
You must be signed in to change notification settings - Fork 1
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
Do not process italic syntax on links. #3
Changes from all commits
a3fa003
77da9bf
11641fd
9b47c31
ae6c3b1
fd14740
42b6b4e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ import Foundation | |
|
||
open class MarkdownItalic: MarkdownCommonElement { | ||
|
||
fileprivate static let regex = "(.?|^)(\\*|_)(?=\\S)(.+?)(?<![\\*_\\s])(\\2)" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This regex was implemented in bmoliveira@761a30e to "fix" when the italic syntax is combined with bold and/or other characters, but it was capturing the preceding character (e.g., when capturing |
||
fileprivate static let regex = "(\\s|^)(\\*|_)(?=\\S)(.+?)(?<![\\*_\\s])(\\2)" | ||
|
||
open var font: MarkdownFont? | ||
open var color: MarkdownColor? | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,8 +159,8 @@ open class MarkdownParser { | |
(.bold, bold), | ||
(.italic, italic), | ||
(.strikethrough, strikethrough), | ||
(.link, link), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the link was being parsed before, it would join the text coming after the link, and the autolink would incorrectly make the following text a part of the link. |
||
(.automaticLink, automaticLink), | ||
(.link, link), | ||
(.code, code), | ||
] | ||
defaultElements = pairs.compactMap { enabled, element in | ||
|
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.
Updated the demo template to showcase more cases (link with underscores and bold+italic vs italic+bold)