mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-01-03 17:38:50 +00:00
19 lines
518 B
Rust
19 lines
518 B
Rust
|
//! # String utilities
|
||
|
//!
|
||
|
//! This module contains utilities that can be used accross all the application
|
||
|
|
||
|
/// Escape an HTML string
|
||
|
///
|
||
|
/// Removes the HTML code included inside a string
|
||
|
///
|
||
|
/// ```
|
||
|
/// use comunic_server::utils::string_utils::remove_html_nodes;
|
||
|
///
|
||
|
/// let s1 = "<b>hello world</b>";
|
||
|
/// let res1 = remove_html_nodes(s1);
|
||
|
/// assert_eq!(res1, "<b>hello world</b>");
|
||
|
/// ```
|
||
|
pub fn remove_html_nodes(input: &str) -> String {
|
||
|
input.replace("<", "<")
|
||
|
.replace(">", ">")
|
||
|
}
|