html-to-react 0.3.0

convert a html string to react
Documentation

html-to-react

quickly convert html props into valid react props

Getting Started

This project takes a html string and replaces the properties with the valid react.js markup.

This helps when using find and replace tools since when you scrape content giving raw html and need a way to convert it back to the form it would be in a codebase to search.

extern crate html_to_react;

fn main(){
    let html = r#"<img class="something" for="mystuff" tabindex="2" style="color: white; background-color: black">"#;
    let react_html = convert_props_react(html.to_string());

    println!("{}", react_html);
    // <img className="something" htmlFor="mystuff" tabIndex="2" style={{color: white, backgroundColor: black}}>
}