Pretty Diff Usage

前端 未结 2 806
青春惊慌失措
青春惊慌失措 2021-01-21 09:15

I want to use this fantastic Javascript Library on my little web project.

http://prettydiff.com/

I\'ve downloaded PrettyDiff.js and ViewDiff.js

I\'ve bee

相关标签:
2条回答
  • 2021-01-21 10:13
        var str = "<html><body><h1>hello</h1></body><html>";
    
        // Options can be viewed at:
        // http://prettydiff.com/documentation.xhtml#function_properties
    
        var options   = {
            source: str,
            mode : "beautify", //  beautify, diff, minify, parse
            lang  : "html",
            wrap : 100,
            inchar : "\t",  // indent character
            insize : 1      // number of indent characters per indent
        }
    
        var pd = prettydiff(options); // returns and array: [beautified, report]
    
        var pretty = pd[0];
        var report = pd[1];
    
        console.log(pretty);
        console.log(report);
    
    0 讨论(0)
  • 2021-01-21 10:18

    Don't exactly know what you want to accomplish, but there are several examples on the site itself. https://prettydiff.com/2/samples.xhtml

    Also, documentation. https://prettydiff.com/documentation.xhtml

    0 讨论(0)
提交回复
热议问题