- fromTree (Tree "Path" stuff _) = URLPath $ map fromUrlChar stuff
- where
- fromUrlChar (Tree "%" [(Tree a [] _),(Tree b [] _)] _) = chr $ (fst $ head $ readHex (a++b))
- fromUrlChar (Tree [c] [] _) = c
- fromUrlChar t = error $ "could not parse as an url char: " ++ (show t)
+ fromTree (Tree "Path" stuff _) = URLPath $ concatMap fromUrlChar stuff
+
+--fromUrlChar (Tree "%" [(Tree a [] _),(Tree b [] _)] _) = chr $ (fst $ head $ readHex (a++b))
+-- FIXME: problem here is the "/" vs "%2F" issue, so we "leave urls urlencoded"
+fromUrlChar (Tree "%" [(Tree a [] _),(Tree b [] _)] _) = "%"++a++b
+fromUrlChar (Tree [c] [] _) = [c]
+fromUrlChar t = error $ "could not parse as an url char: " ++ (show t)