Compare commits

..

No commits in common. "91dc938fb1ed930615e783f033297e0e7d616cf8" and "a7aec1b94e6d203b29d0d9387d06594fab4ddbf5" have entirely different histories.

View file

@ -146,7 +146,7 @@ pub fn get_options<'a>() -> ComrakOptions<'a> {
options.extension.greentext = false; options.extension.greentext = false;
// Parser // Parser
options.parse.smart = false; // could be boring options.parse.smart = true; // could be boring
options.parse.default_info_string = Some("plaintext".into()); options.parse.default_info_string = Some("plaintext".into());
options.parse.relaxed_tasklist_matching = true; options.parse.relaxed_tasklist_matching = true;
options.parse.relaxed_autolinks = true; options.parse.relaxed_autolinks = true;
@ -178,7 +178,7 @@ fn custom_img_size(html: &str) -> String {
RewriteStrSettings { RewriteStrSettings {
element_content_handlers: vec![element!("img[alt]", |el| { element_content_handlers: vec![element!("img[alt]", |el| {
let alt = el.get_attribute("alt").unwrap(); let alt = el.get_attribute("alt").unwrap();
let possible_piece = alt.split('|').collect::<Vec<&str>>(); let possible_piece = alt.split(|c| c == '|').collect::<Vec<&str>>();
if possible_piece.len() > 1 { if possible_piece.len() > 1 {
let data = possible_piece.last().unwrap().trim(); let data = possible_piece.last().unwrap().trim();
@ -289,8 +289,6 @@ pub fn read_md(
let mermaid_name = "mermaid"; let mermaid_name = "mermaid";
hljs_replace(root, mermaid_name); hljs_replace(root, mermaid_name);
replace_quotes(root);
// Convert to HTML // Convert to HTML
let mut html = vec![]; let mut html = vec![];
format_html(root, &opt, &mut html).unwrap(); format_html(root, &opt, &mut html).unwrap();
@ -436,20 +434,6 @@ fn hljs_replace<'a>(root: &'a AstNode<'a>, mermaid_str: &str) {
}); });
} }
/// TODO
fn replace_quotes<'a>(node: &'a AstNode<'a>) {
match &mut node.data.borrow_mut().value {
NodeValue::Text(text) => {
*text = text.replacen('"', "«", 1).replacen('"', "»", 1);
}
_ => {
for c in node.children() {
replace_quotes(c);
}
}
}
}
/// Obfuscate email if email found /// Obfuscate email if email found
fn mail_obfuscation(html: &str) -> (String, bool) { fn mail_obfuscation(html: &str) -> (String, bool) {
let modified = Arc::new(AtomicBool::new(false)); let modified = Arc::new(AtomicBool::new(false));