this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

update readme

+17 -15
+17 -15
README.md
··· 1 - # houdini 1 + # Houdini's publicist 2 2 3 - [![Package Version](https://img.shields.io/hexpm/v/houdini)](https://hex.pm/packages/houdini) 4 - [![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/houdini/) 3 + A fork of [houdini](https://github.com/giacomocavalieri/houdini) that adds a function specifically for escaping attributes but only adds quotes when the string isn't alphanumeric or one of `-_./:`. Why would you want this? Well to have a slightly smaller html file size. Probably not worth it! 🤷 5 4 6 - 🪄 Fast HTML escaping 5 + This isn't added to Hex, so you'll have to add it as a git dependency in your `gleam.toml`: 7 6 8 - ```sh 9 - gleam add houdini@1 10 7 ``` 11 - 12 - Use `houdini.escape` to escape any string to be safely used inside an HTML 13 - document: 8 + houdinis_publicist = { git = "https://github.com/bentomas/houdinis_publicist.git", ref = "595cdc46" } 9 + ``` 14 10 15 - ```gleam 16 - import houdini 11 + It automatically adds the quotes for you if they are necessary: 17 12 18 - pub fn main() -> Nil { 19 - assert houdini.escape("wibble & wobble") == "wibble & wobble" 20 - assert houdini.escape("wibble > wobble") == "wibble > wobble" 21 - } 22 13 ``` 14 + houdinis_publicist.escape_attribute("abcd") 15 + // => "abcd" 16 + 17 + houdinis_publicist.escape_attribute("ab_cd") 18 + // => "ab_cd" 19 + 20 + houdinis_publicist.escape_attribute("ab cd") 21 + // => "\"ab cd\"" 22 + 23 + houdinis_publicist.escape_attribute("a\"") 24 + // => "\"a"\""