Skip to content

Commit

Permalink
Disable some substitution rules
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Oct 10, 2024
1 parent f2f57fb commit 0337a6d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/url/nettlesome.UrlInterpolator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ object UrlInterpolator extends contextual.Interpolator[UrlFragment, Text, Url[La
state+port.show

case UrlFragment.Textual(text) =>
if !state.ends(t"/")
then throw InterpolationError(m"a substitution may only be made after a slash")
// if !state.ends(t"/")
// then throw InterpolationError(m"a substitution may only be made after a slash")

try throwErrors(Url.parse(state+text.urlEncode)) catch
case err: UrlError => throw InterpolationError(Message(err.message.text))
Expand All @@ -69,8 +69,8 @@ object UrlInterpolator extends contextual.Interpolator[UrlFragment, Text, Url[La
state+text.urlEncode

case UrlFragment.RawTextual(text) =>
if !state.ends(t"/")
then throw InterpolationError(m"a substitution may only be made after a slash")
// if !state.ends(t"/")
// then throw InterpolationError(m"a substitution may only be made after a slash")

try throwErrors(Url.parse(state+text.urlEncode)) catch
case err: UrlError => throw InterpolationError(Message(err.message.text))
Expand All @@ -81,8 +81,8 @@ object UrlInterpolator extends contextual.Interpolator[UrlFragment, Text, Url[La
override def substitute(state: Text, sub: Text): Text = state+sub

def parse(state: Text, next: Text): Text =
if !state.empty && !(next.starts(t"/") || next.empty)
then throw InterpolationError(m"a substitution must be followed by a slash")
//if !state.empty && !(next.starts(t"/") || next.empty)
//then throw InterpolationError(m"a substitution must be followed by a slash")

state+next

Expand Down

0 comments on commit 0337a6d

Please sign in to comment.