converting prettydiff to prettydiff2
This commit is contained in:
parent
c87e3c386e
commit
d57c90c2e3
|
@ -175,7 +175,7 @@
|
|||
"node-dir": "0.1.17",
|
||||
"node-uuid": "1.4.8",
|
||||
"open": "0.0.5",
|
||||
"prettydiff": "1.16.37",
|
||||
"prettydiff2": "2.2.3",
|
||||
"pug-beautify": "^0.1.1",
|
||||
"remark": "6.0.1",
|
||||
"season": "6.0.0",
|
||||
|
@ -422,7 +422,7 @@
|
|||
"typescript-formatter",
|
||||
"tidy-markdown",
|
||||
"underscore-plus",
|
||||
"prettydiff"
|
||||
"prettydiff2"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -434,7 +434,7 @@
|
|||
"typescript-formatter",
|
||||
"tidy-markdown",
|
||||
"underscore-plus",
|
||||
"prettydiff"
|
||||
"prettydiffi2"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ module.exports = class PrettyDiff extends Beautifier
|
|||
beautify: (text, language, options) ->
|
||||
options.crlf = @getDefaultLineEnding(true,false,options.end_of_line)
|
||||
return new @Promise((resolve, reject) =>
|
||||
prettydiff = require("prettydiff")
|
||||
prettydiff = require("prettydiff2")
|
||||
_ = require('lodash')
|
||||
|
||||
# Select Prettydiff language
|
||||
|
@ -127,8 +127,7 @@ module.exports = class PrettyDiff extends Beautifier
|
|||
|
||||
# Beautify
|
||||
@verbose('prettydiff', options)
|
||||
output = prettydiff.api(options)
|
||||
result = output[0]
|
||||
result = prettydiff(options)
|
||||
|
||||
# Return beautified text
|
||||
resolve(result)
|
||||
|
|
|
@ -10,7 +10,7 @@ module.exports = class VueBeautifier extends Beautifier
|
|||
|
||||
beautify: (text, language, options) ->
|
||||
return new @Promise((resolve, reject) =>
|
||||
prettydiff = require("prettydiff")
|
||||
prettydiff = require("prettydiff2")
|
||||
_ = require('lodash')
|
||||
regexp = /(^<(template|script|style)[^>]*>)((\s|\S)*?)^<\/\2>/gim
|
||||
|
||||
|
@ -37,14 +37,14 @@ module.exports = class VueBeautifier extends Beautifier
|
|||
lang: "scss"
|
||||
mode: "beautify"
|
||||
)
|
||||
prettydiff.api(options)[0]
|
||||
prettydiff(options)
|
||||
when "less"
|
||||
options = _.merge(options,
|
||||
source: text
|
||||
lang: "less"
|
||||
mode: "beautify"
|
||||
)
|
||||
prettydiff.api(options)[0]
|
||||
prettydiffoptions)
|
||||
when undefined
|
||||
require("js-beautify").css(text, options)
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue