File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ import Data.Lens.Record (prop)
1010import Data.List (List (Nil))
1111import Data.Maybe (Maybe (..), maybe )
1212import Data.Set as Set
13- import Data.String.Pattern (Pattern (..))
14- import Data.String.Common (split )
13+ import Data.String (replaceAll , split , Pattern (..), Replacement (..))
1514import Data.Symbol (SProxy (..))
1615import Effect.Class (class MonadEffect , liftEffect )
1716import Global (encodeURIComponent )
@@ -163,10 +162,14 @@ updateWindowLocation { pixels, context } =
163162 liftEffect do
164163 w <- window
165164 l <- location w
166- for_ (encodeURIComponent pixels) \p ->
167- for_ (encodeURIComponent context) \c ->
165+ for_ (escape pixels) \p ->
166+ for_ (escape context) \c ->
168167 setHash (" pixels=" <> p <> " &context=" <> c) l
169168
169+ escape :: String -> Maybe String
170+ escape s = encodeURIComponent s
171+ <#> replaceAll (Pattern " (" ) (Replacement " %28" )
172+ <#> replaceAll (Pattern " )" ) (Replacement " %29" )
170173
171174parsePixels :: String -> Array (Array String )
172175parsePixels = map (split (Pattern " " )) <<< split (Pattern " \n " )
You can’t perform that action at this time.
0 commit comments