parsoid 0.10.1

Wrapper around Parsoid HTML that provides convenient accessors for processing and manipulation
Documentation
mod api;
mod cite;
mod gallery;
mod image;
mod indicator;
mod parsoid;
pub(crate) mod test_client;

use super::*;

#[test]
fn test_clean_link() {
    assert_eq!(
        clean_link("./Template:Foo_bar"),
        "Template:Foo bar".to_string()
    );
    assert_eq!(clean_link("ifeq"), "ifeq".to_string());
}

#[test]
fn test_full_link() {
    assert_eq!(
        full_link("Template:Foo bar"),
        "./Template:Foo_bar".to_string()
    );
    // Yes, this is not what you'd expect. It's not a direct reversal of clean_link()
    assert_eq!(full_link("ifeq"), "./ifeq".to_string());
}

#[test]
fn test_attribute_contains_word() {
    assert!(attribute_contains_word("mw:Foo", "mw:Foo")); // yes
    assert!(!attribute_contains_word("mw:Foo", "mw:Bar")); // no
    assert!(attribute_contains_word("mw:Foo mw:Bar", "mw:Bar")); // yes
    assert!(!attribute_contains_word("mw:Foo/Bar", "mw:Foo")); // no
}