rustyphoenixlecture 1.4.0

This project aims to provide a simple a powerfull lecture compilation to generate html web sites
/***************************************
	Auteur : Pierre Aubert
	Mail : pierre.aubert@lapp.in2p3.fr
	Licence : CeCILL-C
****************************************/

///Convert classic text into html
/// # Parameters
/// - `text` : string to be converted into html
/// # Returns
/// Converted string into html
pub fn lecture_str_to_html(text: &String) -> String{
	let mut tmp = text.replace("&", "&");
	tmp = tmp.replace("<", "&lt;");
	tmp = tmp.replace(">", "&gt;");
	tmp = tmp.replace("\\\"\\\\\\\"", "&bsol;&quot;&bsol;&bsol;&bsol;&quot;");
	tmp = tmp.replace("\\\\\\\"\\\"", "&bsol;&bsol;&bsol;&quot;&bsol;&quot;");
	tmp = tmp.replace("\"", "&quot;");
	tmp = tmp.replace("\\dots{}", "...");
	tmp = tmp.replace("\\'e", "é");
	tmp = tmp.replace("\\'", "");
	tmp = tmp.replace("~", "&#126;");
	tmp = tmp.replace("\\and", "&amp;");
	tmp = tmp.replace("\\,", "");
	tmp = tmp.replace("\\", "&bsol;");
	return tmp;
}


#[cfg(test)]
mod tests{
	use super::*;
	
	///Test the lecture_str_to_html
	#[test]
	fn test_lecture_str_to_html(){
		assert_eq!(lecture_str_to_html(&String::from("\"shadoko\"")), String::from("&quot;shadoko&quot;"));
	}
}