Skip to content

Commit

Permalink
Fix Safelist static functions and add copy function
Browse files Browse the repository at this point in the history
  • Loading branch information
JonMcPherson committed Jul 7, 2023
1 parent 7285108 commit c44a608
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions core/src/main/scala/com/iterable/scalasoup/Safelist.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,18 @@ final case class Safelist private[scalasoup] (
object Safelist {
type SafelistCall = org.jsoup.safety.Safelist => Unit

def none: Safelist = Safelist(() => org.jsoup.safety.Safelist.none(), List.empty[SafelistCall])
def copy(other: Safelist): Safelist = copy(other.underlying)

def simpleText: Safelist = Safelist(() => org.jsoup.safety.Safelist.none(), List.empty[SafelistCall])
def copy(underlying: org.jsoup.safety.Safelist): Safelist =
Safelist(() => new org.jsoup.safety.Safelist(underlying), List.empty)

def basic: Safelist = Safelist(() => org.jsoup.safety.Safelist.none(), List.empty[SafelistCall])
def none: Safelist = Safelist(() => org.jsoup.safety.Safelist.none(), List.empty)

def basicWithImages: Safelist = Safelist(() => org.jsoup.safety.Safelist.none(), List.empty[SafelistCall])
def simpleText: Safelist = Safelist(() => org.jsoup.safety.Safelist.simpleText(), List.empty)

def relaxed: Safelist = Safelist(() => org.jsoup.safety.Safelist.none(), List.empty[SafelistCall])
def basic: Safelist = Safelist(() => org.jsoup.safety.Safelist.basic(), List.empty)

def basicWithImages: Safelist = Safelist(() => org.jsoup.safety.Safelist.basicWithImages(), List.empty)

def relaxed: Safelist = Safelist(() => org.jsoup.safety.Safelist.relaxed(), List.empty)
}

0 comments on commit c44a608

Please sign in to comment.