File tree 4 files changed +5
-5
lines changed
main/scala/no/ndla/validation
test/scala/no/ndla/validation
4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import org.jsoup.nodes.Element
14
14
import org .jsoup .nodes .Entities .EscapeMode
15
15
16
16
import scala .io .Source
17
- import scala .jdk .CollectionConverters ._
17
+ import scala .jdk .CollectionConverters .*
18
18
19
19
object HtmlTagRules {
20
20
Original file line number Diff line number Diff line change @@ -573,7 +573,7 @@ object TagValidator {
573
573
if (! field.validation.required && value.isEmpty) {
574
574
return None
575
575
}
576
- if (value.matches(domainRegex)) {
576
+ if (value.trim. matches(domainRegex)) {
577
577
if (field.validation.allowedDomains.isEmpty) None
578
578
else {
579
579
val urlHost = value.hostOption.map(_.toString).getOrElse(" " )
Original file line number Diff line number Diff line change @@ -76,10 +76,10 @@ object TextValidator {
76
76
allowedTags : Set [String ]
77
77
): Seq [ValidationMessage ] = {
78
78
79
- val whiteList = new Safelist ().addTags(allowedTags.toSeq: _ * )
79
+ val whiteList = new Safelist ().addTags(allowedTags.toSeq* )
80
80
HtmlTagRules .allLegalTags
81
81
.filter(tag => HtmlTagRules .legalAttributesForTag(tag).nonEmpty)
82
- .foreach(tag => whiteList.addAttributes(tag, HtmlTagRules .legalAttributesForTag(tag).toSeq: _ * ))
82
+ .foreach(tag => whiteList.addAttributes(tag, HtmlTagRules .legalAttributesForTag(tag).toSeq* ))
83
83
84
84
if (text.isEmpty) {
85
85
Seq .empty
Original file line number Diff line number Diff line change 8
8
9
9
package no .ndla .validation
10
10
11
- import org .scalatest ._
11
+ import org .scalatest .*
12
12
import org .scalatest .funsuite .AnyFunSuite
13
13
import org .scalatest .matchers .should .Matchers
14
14
You can’t perform that action at this time.
0 commit comments