[−][src]Module crowbook_text_processing::escape
Some functions to escape character for display in HTML or LaTeX.
The two most useful ones are tex and html.
Example
use crowbook_text_processing::escape; let input = "<foo> & <bar>"; let output = escape::html(input); assert_eq!(&output, "<foo> & <bar>"); let input = "#2: 20%"; let output = escape::tex(input); assert_eq!(&output, r"\#2: 20\%");
Functions
| html | Escape characters for HTML output, replacing |
| nb_spaces_html | Escape narrow non-breaking spaces for HTML. |
| nb_spaces_tex | Escape non breaking spaces for LaTeX, replacing them with the appropriate TeX code. This ensures it works correctly with some LaTeX versions (and it makes the non-breaking spaces shenanigans more visible with most editors) |
| nnbsp | Deprecated Old name of nb_spaces html |
| quotes | Very naively escape quotes |
| tex | Escape characters for LaTeX |