package liquid_std
The Standard Libarary for Liquid
Install
Dune Dependency
Authors
Maintainers
Sources
0.1.2.tar.gz
md5=ddfb85944a4604cfe8e614363862f882
sha512=7a9e4582f8a773e953f6fb124c757a883f4528c130a1fc53c19c74b9a4006e505d4fcf0014393624c8e57c463a96db653e922f951cc88802f552a6fcef7eb097
doc/src/liquid_std/encoder.ml.html
Source file encoder.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
open Base open Liquid_syntax open Tools let has_encoded_text text = let exp = ~/"&#?[a-zA-Z0-9]{2,10};" in Re2.matches exp text type encode_decode = Encode | Decode let encode_decode_url reps encode_decode url = let folder acc (d, e) = let p, w = match encode_decode with Encode -> (d, e) | Decode -> (e, d) in String.substr_replace_all acc ~pattern:p ~with_:w in List.fold reps ~init:url ~f:folder let encode_decode_text reps encode_decode text = let folder acc (unicode_value, number_encoded, name_encoded) = match encode_decode with | Encode -> String.substr_replace_all acc ~pattern:unicode_value ~with_:number_encoded | Decode -> ( acc |> String.substr_replace_all ~pattern:number_encoded ~with_:unicode_value |> String.substr_replace_all ~pattern:name_encoded ~with_:unicode_value ) in List.fold reps ~init:text ~f:folder let url_reps = [ ("%", "%25") ; (":", "%3A") ; ("/", "%2F") ; ("?", "%3F") ; ("#", "%23") ; ("[", "%5B") ; ("]", "%5D") ; ("@", "%40") ; ("!", "%21") ; ("$", "%24") ; ("&", "%26") ; ("\'", "%27") ; ("(", "%28") ; (")", "%29") ; ("*", "%2A") ; ("+", "%2B") ; (",", "%2C") ; (";", "%3B") ; ("=", "%3D") ; (" ", "+") ] let text_reps = [ ("&", "&", "&") ; ("\"", """, """) ; ("'", "'", "'") ; ("<", "<", "<") ; (">", ">", ">") ; ("Œ", "Œ", "Œ") ; ("œ", "œ", "œ") ; ("Š", "Š", "Š") ; ("š", "š", "š") ; ("Ÿ", "Ÿ", "Ÿ") ; ("ƒ", "ƒ", "ƒ") ; ("ˆ", "ˆ", "ˆ") ; ("˜", "˜", "˜") ; (" ", " ", " ") ; (" ", " ", " ") ; (" ", " ", " ") ; ("", "‌", "‌") ; ("", "‍", "‍") ; ("", "‎", "‎") ; ("", "‏", "‏") ; ("–", "–", "–") ; ("—", "—", "—") ; ("‘", "‘", "‘") ; ("’", "’", "’") ; ("‚", "‚", "‚") ; ("“", "“", "“") ; ("”", "”", "”") ; ("„", "„", "„") ; ("†", "†", "†") ; ("‡", "‡", "‡") ; ("•", "•", "•") ; ("…", "…", "…") ; ("‰", "‰", "‰") ; ("′", "′", "′") ; ("″", "″", "″") ; ("‹", "‹", "‹") ; ("›", "›", "›") ; ("‾", "‾", "‾") ; ("€", "€", "€") ; ("™", "™", "™") ; ("←", "←", "←") ; ("↑", "↑", "↑") ; ("→", "→", "→") ; ("↓", "↓", "↓") ; ("↔", "↔", "↔") ; ("↵", "↵", "↵") ; ("⌈", "⌈", "⌈") ; ("⌉", "⌉", "⌉") ; ("⌊", "⌊", "⌊") ; ("⌋", "⌋", "⌋") ; ("◊", "◊", "◊") ; ("♠", "♠", "♠") ; ("♣", "♣", "♣") ; ("♥", "♥", "♥") ; ("♦", "♦", "♦") ; ("∀", "∀", "∀") ; ("∂", "∂", "∂") ; ("∃", "∃", "∃") ; ("∅", "∅", "∅") ; ("∇", "∇", "∇") ; ("∈", "∈", "∈") ; ("∉", "∉", "∉") ; ("∋", "∋", "∋") ; ("∏", "∏", "∏") ; ("∑", "∑", "∑") ; ("−", "−", "−") ; ("∗", "∗", "∗") ; ("√", "√", "√") ; ("∝", "∝", "∝") ; ("∞", "∞", "∞") ; ("∠", "∠", "∠") ; ("∧", "∧", "∧") ; ("∨", "∨", "∨") ; ("∩", "∩", "∩") ; ("∪", "∪", "∪") ; ("∫", "∫", "∫") ; ("∴", "∴", "∴") ; ("∼", "∼", "∼") ; ("≅", "≅", "≅") ; ("≈", "≈", "≈") ; ("≠", "≠", "≠") ; ("≡", "≡", "≡") ; ("≤", "≤", "≤") ; ("≥", "≥", "≥") ; ("⊂", "⊂", "⊂") ; ("⊃", "⊃", "⊃") ; ("⊄", "⊄", "⊄") ; ("⊆", "⊆", "⊆") ; ("⊇", "⊇", "⊇") ; ("⊕", "⊕", "⊕") ; ("⊗", "⊗", "⊗") ; ("⊥", "⊥", "⊥") ; ("⋅", "⋅", "⋅") ; ("Α", "Α", "Α") ; ("Β", "Β", "Β") ; ("Γ", "Γ", "Γ") ; ("Δ", "Δ", "Δ") ; ("Ε", "Ε", "Ε") ; ("Ζ", "Ζ", "Ζ") ; ("Η", "Η", "Η") ; ("Θ", "Θ", "Θ") ; ("Ι", "Ι", "Ι") ; ("Κ", "Κ", "Κ") ; ("Λ", "Λ", "Λ") ; ("Μ", "Μ", "Μ") ; ("Ν", "Ν", "Ν") ; ("Ξ", "Ξ", "Ξ") ; ("Ο", "Ο", "Ο") ; ("Π", "Π", "Π") ; ("Ρ", "Ρ", "Ρ") ; ("Σ", "Σ", "Σ") ; ("Τ", "Τ", "Τ") ; ("Υ", "Υ", "Υ") ; ("Φ", "Φ", "Φ") ; ("Χ", "Χ", "Χ") ; ("Ψ", "Ψ", "Ψ") ; ("Ω", "Ω", "Ω") ; ("α", "α", "α") ; ("β", "β", "β") ; ("γ", "γ", "γ") ; ("δ", "δ", "δ") ; ("ε", "ε", "ε") ; ("ζ", "ζ", "ζ") ; ("η", "η", "η") ; ("θ", "θ", "θ") ; ("ι", "ι", "ι") ; ("κ", "κ", "κ") ; ("λ", "λ", "λ") ; ("μ", "μ", "μ") ; ("ν", "ν", "ν") ; ("ξ", "ξ", "ξ") ; ("ο", "ο", "ο") ; ("π", "π", "π") ; ("ρ", "ρ", "ρ") ; ("ς", "ς", "ς") ; ("σ", "σ", "σ") ; ("τ", "τ", "τ") ; ("υ", "υ", "υ") ; ("φ", "φ", "φ") ; ("χ", "χ", "χ") ; ("ψ", "ψ", "ψ") ; ("ω", "ω", "ω") ; ("ϑ", "ϑ", "ϑ") ; ("ϒ", "ϒ", "ϒ") ; ("ϖ", "ϖ", "ϖ") ; ("À", "À", "À") ; ("Á", "Á", "Á") ; ("Â", "Â", "Â") ; ("Ã", "Ã", "Ã") ; ("Ä", "Ä", "Ä") ; ("Å", "Å", "Å") ; ("Æ", "Æ", "Æ") ; ("Ç", "Ç", "Ç") ; ("È", "È", "È") ; ("É", "É", "É") ; ("Ê", "Ê", "Ê") ; ("Ë", "Ë", "Ë") ; ("Ì", "Ì", "Ì") ; ("Í", "Í", "Í") ; ("Î", "Î", "Î") ; ("Ï", "Ï", "Ï") ; ("Ð", "Ð", "Ð") ; ("Ñ", "Ñ", "Ñ") ; ("Ò", "Ò", "Ò") ; ("Ó", "Ó", "Ó") ; ("Ô", "Ô", "Ô") ; ("Õ", "Õ", "Õ") ; ("Ö", "Ö", "Ö") ; ("Ø", "Ø", "Ø") ; ("Ù", "Ù", "Ù") ; ("Ú", "Ú", "Ú") ; ("Û", "Û", "Û") ; ("Ü", "Ü", "Ü") ; ("Ý", "Ý", "Ý") ; ("Þ", "Þ", "Þ") ; ("ß", "ß", "ß") ; ("à", "à", "à") ; ("á", "á", "á") ; ("â", "â", "â") ; ("ã", "ã", "ã") ; ("ä", "ä", "ä") ; ("å", "å", "å") ; ("æ", "æ", "æ") ; ("ç", "ç", "ç") ; ("è", "è", "è") ; ("é", "é", "é") ; ("ê", "ê", "ê") ; ("ë", "ë", "ë") ; ("ì", "ì", "ì") ; ("í", "í", "í") ; ("î", "î", "î") ; ("ï", "ï", "ï") ; ("ð", "ð", "ð") ; ("ñ", "ñ", "ñ") ; ("ò", "ò", "ò") ; ("ó", "ó", "ó") ; ("ô", "ô", "ô") ; ("õ", "õ", "õ") ; ("ö", "ö", "ö") ; ("ø", "ø", "ø") ; ("ù", "ù", "ù") ; ("ú", "ú", "ú") ; ("û", "û", "û") ; ("ü", "ü", "ü") ; ("ý", "ý", "ý") ; ("þ", "þ", "þ") ; ("ÿ", "ÿ", "ÿ") ; (" ", " ", " ") ; ("¡", "¡", "¡") ; ("¢", "¢", "¢") ; ("£", "£", "£") ; ("¤", "¤", "¤") ; ("¥", "¥", "¥") ; ("¦", "¦", "¦") ; ("§", "§", "§") ; ("¨", "¨", "¨") ; ("©", "©", "©") ; ("ª", "ª", "ª") ; ("«", "«", "«") ; ("¬", "¬", "¬") ; ("", "­", "­") ; ("®", "®", "®") ; ("¯", "¯", "¯") ; ("°", "°", "°") ; ("±", "±", "±") ; ("²", "²", "²") ; ("³", "³", "³") ; ("´", "´", "´") ; ("µ", "µ", "µ") ; ("¶", "¶", "¶") ; ("·", "·", "·") ; ("¸", "¸", "¸") ; ("¹", "¹", "¹") ; ("º", "º", "º") ; ("»", "»", "»") ; ("¼", "¼", "¼") ; ("½", "½", "½") ; ("¾", "¾", "¾") ; ("¿", "¿", "¿") ; ("×", "×", "×") ; ("÷", "÷", "÷") ] let encode_url = encode_decode_url url_reps Encode let decode_url = encode_decode_url url_reps Decode let encode_text = encode_decode_text text_reps Encode let decode_text = encode_decode_text text_reps Decode let escape_url url = encode_url url |> String.substr_replace_all ~pattern:"+" ~with_:"%20" |> String.substr_replace_all ~pattern:"%26" ~with_:"&" let escape_param_url url = encode_url url |> String.substr_replace_all ~pattern:"+" ~with_:"%20"
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>