File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -73,9 +73,8 @@ object EntityLink {
73
73
def unapply (el : EntityLink ): Option [(Inline , LinkTo )] = Some ((el.title, el.link))
74
74
}
75
75
final case class HtmlTag (data : String ) extends Inline {
76
- private val Pattern = """ (?ms)\A<(/?)(.*?)[\s>].*\z""" .r
77
76
private val (isEnd, tagName) = data match {
78
- case Pattern (s1, s2) =>
77
+ case HtmlTag . Pattern (s1, s2) =>
79
78
(! s1.isEmpty, Some (s2.toLowerCase))
80
79
case _ =>
81
80
(false , None )
@@ -85,11 +84,14 @@ final case class HtmlTag(data: String) extends Inline {
85
84
isEnd && tagName == open.tagName
86
85
}
87
86
88
- private val TagsNotToClose = Set (" br" , " img" )
89
87
def close = tagName collect {
90
- case name if ! TagsNotToClose (name) && ! data.endsWith(s " </ $name> " ) => HtmlTag (s " </ $name> " )
88
+ case name if ! HtmlTag . TagsNotToClose (name) && ! data.endsWith(s " </ $name> " ) => HtmlTag (s " </ $name> " )
91
89
}
92
90
}
91
+ object HtmlTag {
92
+ private val Pattern = """ (?ms)\A<(/?)(.*?)[\s>].*\z""" .r
93
+ private val TagsNotToClose = Set (" br" , " img" )
94
+ }
93
95
94
96
/** The summary of a comment, usually its first sentence. There must be exactly one summary per body. */
95
97
final case class Summary (text : Inline ) extends Inline
You can’t perform that action at this time.
0 commit comments