Merge pull request #1878 from Glavin001/prettydiff-prettydiff2
Update to Prettydiff 2
This commit is contained in:
commit
96d71f8e01
|
@ -56,7 +56,7 @@ matrix:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- APM_TEST_PACKAGES="language-marko language-html-swig language-svg language-d mavensmate-atom language-lua language-puppet"
|
- APM_TEST_PACKAGES="language-marko language-html-swig language-svg language-d mavensmate-atom language-lua language-puppet fuse"
|
||||||
- PATH="/home/travis/gopath/bin:$HOME/.linuxbrew/bin:$PATH"
|
- PATH="/home/travis/gopath/bin:$HOME/.linuxbrew/bin:$PATH"
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
# Next
|
# Next
|
||||||
|
- See [#881](https://github.com/Glavin001/atom-beautify/issues/881). Update to Prettydiff version 2!
|
||||||
- ...
|
- ...
|
||||||
|
|
||||||
# v0.30.5 (2017-08-11)
|
# v0.30.5 (2017-08-11)
|
||||||
|
|
|
@ -133,7 +133,7 @@ build_script:
|
||||||
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
- cd %APPVEYOR_BUILD_FOLDER%
|
||||||
# Install languages to Atom
|
# Install languages to Atom
|
||||||
- apm install language-marko language-html-swig language-svg language-elm language-d mavensmate-atom language-lua
|
- apm install language-marko language-html-swig language-svg language-elm language-d mavensmate-atom language-lua language-puppet fuse
|
||||||
# Show current PATH
|
# Show current PATH
|
||||||
- echo %PATH%
|
- echo %PATH%
|
||||||
# Run tests on package
|
# Run tests on package
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
<DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
||||||
<title>Shopping List for
|
|
||||||
<%= @date.strftime('%A, %d %B %Y') %></title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Shopping List for
|
|
||||||
<%= @date.strftime('%A, %d %B %Y') %></h1>
|
|
||||||
<p>You need to buy:</p>
|
|
||||||
<ul>
|
|
||||||
<% for @item in @items %>
|
|
||||||
<li><%= h(@item) %></li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||||
|
<title>Shopping List for
|
||||||
|
<%= @date.strftime('%A, %d %B %Y') %></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Shopping List for
|
||||||
|
<%= @date.strftime('%A, %d %B %Y') %></h1>
|
||||||
|
<p>You need to buy:</p>
|
||||||
|
<ul>
|
||||||
|
<% for @item in @items %>
|
||||||
|
<li><%= h(@item) %></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,4 +1,4 @@
|
||||||
<DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
@ -113,6 +113,7 @@
|
||||||
.slideIn {
|
.slideIn {
|
||||||
.animation(SlideIn, 0.5s);
|
.animation(SlideIn, 0.5s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@-webkit-keyframes SlideIn {
|
@-webkit-keyframes SlideIn {
|
||||||
0% {
|
0% {
|
||||||
.transform(translateY(-100%));
|
.transform(translateY(-100%));
|
||||||
|
@ -127,6 +128,7 @@
|
||||||
display: block;
|
display: block;
|
||||||
.animation(FadeIn, 0.5s);
|
.animation(FadeIn, 0.5s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@-webkit-keyframes FadeIn {
|
@-webkit-keyframes FadeIn {
|
||||||
0% {
|
0% {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
@ -140,6 +142,7 @@
|
||||||
.slideOut {
|
.slideOut {
|
||||||
.animation(SlideOut, 0.5s);
|
.animation(SlideOut, 0.5s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@-webkit-keyframes SlideOut {
|
@-webkit-keyframes SlideOut {
|
||||||
0% {
|
0% {
|
||||||
.transform(translateY(0%));
|
.transform(translateY(0%));
|
||||||
|
@ -153,6 +156,7 @@
|
||||||
.fadeOut {
|
.fadeOut {
|
||||||
.animation(FadeOut, 0.5s);
|
.animation(FadeOut, 0.5s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@-webkit-keyframes FadeOut {
|
@-webkit-keyframes FadeOut {
|
||||||
0% {
|
0% {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
]
|
]
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped="scoped">
|
||||||
:scope {
|
:scope {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/* kendo UI */
|
/* kendo UI */
|
||||||
|
|
||||||
@import "variables";
|
@import "variables";
|
||||||
|
|
||||||
// slider
|
// slider
|
||||||
|
|
|
@ -179,7 +179,7 @@
|
||||||
"node-dir": "0.1.17",
|
"node-dir": "0.1.17",
|
||||||
"node-uuid": "1.4.8",
|
"node-uuid": "1.4.8",
|
||||||
"open": "0.0.5",
|
"open": "0.0.5",
|
||||||
"prettydiff": "1.16.37",
|
"prettydiff2": "^2.2.7",
|
||||||
"pug-beautify": "^0.1.1",
|
"pug-beautify": "^0.1.1",
|
||||||
"remark": "6.0.1",
|
"remark": "6.0.1",
|
||||||
"season": "6.0.0",
|
"season": "6.0.0",
|
||||||
|
@ -426,7 +426,7 @@
|
||||||
"typescript-formatter",
|
"typescript-formatter",
|
||||||
"tidy-markdown",
|
"tidy-markdown",
|
||||||
"underscore-plus",
|
"underscore-plus",
|
||||||
"prettydiff"
|
"prettydiff2"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -438,7 +438,7 @@
|
||||||
"typescript-formatter",
|
"typescript-formatter",
|
||||||
"tidy-markdown",
|
"tidy-markdown",
|
||||||
"underscore-plus",
|
"underscore-plus",
|
||||||
"prettydiff"
|
"prettydiff2"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -44,16 +44,16 @@ describe "BeautifyLanguages", ->
|
||||||
|
|
||||||
# Activate all of the languages
|
# Activate all of the languages
|
||||||
allLanguages = [
|
allLanguages = [
|
||||||
"c", "clojure", "coffee-script", "css", "d", "html",
|
"c", "clojure", "coffee-script", "css", "csharp", "d",
|
||||||
"java", "javascript", "json", "less",
|
"gfm", "go", "html", "html-swig", "java", "javascript",
|
||||||
"mustache", "objective-c", "perl", "php",
|
"json", "less", "lua", "marko", "mustache", "objective-c",
|
||||||
"python", "ruby", "sass", "sql", "svg",
|
"perl", "php", "python", "ruby", "sass", "sql",
|
||||||
"xml", "csharp", "gfm", "marko",
|
"svg", "xml"
|
||||||
"go", "html-swig", "lua"
|
|
||||||
]
|
]
|
||||||
# All Atom packages that Atom Beautify is dependent on
|
# All Atom packages that Atom Beautify is dependent on
|
||||||
dependentPackages = [
|
dependentPackages = [
|
||||||
'autocomplete-plus'
|
'autocomplete-plus'
|
||||||
|
'fuse'
|
||||||
# 'linter'
|
# 'linter'
|
||||||
# 'atom-typescript' # it logs too much...
|
# 'atom-typescript' # it logs too much...
|
||||||
]
|
]
|
||||||
|
|
|
@ -73,7 +73,7 @@ module.exports = class PrettyDiff extends Beautifier
|
||||||
beautify: (text, language, options) ->
|
beautify: (text, language, options) ->
|
||||||
options.crlf = @getDefaultLineEnding(true,false,options.end_of_line)
|
options.crlf = @getDefaultLineEnding(true,false,options.end_of_line)
|
||||||
return new @Promise((resolve, reject) =>
|
return new @Promise((resolve, reject) =>
|
||||||
prettydiff = require("prettydiff")
|
prettydiff = require("prettydiff2")
|
||||||
_ = require('lodash')
|
_ = require('lodash')
|
||||||
|
|
||||||
# Select Prettydiff language
|
# Select Prettydiff language
|
||||||
|
@ -81,8 +81,6 @@ module.exports = class PrettyDiff extends Beautifier
|
||||||
switch language
|
switch language
|
||||||
when "CSV"
|
when "CSV"
|
||||||
lang = "csv"
|
lang = "csv"
|
||||||
when "Coldfusion"
|
|
||||||
lang = "html"
|
|
||||||
when "EJS", "Twig"
|
when "EJS", "Twig"
|
||||||
lang = "ejs"
|
lang = "ejs"
|
||||||
when "ERB"
|
when "ERB"
|
||||||
|
@ -91,9 +89,9 @@ module.exports = class PrettyDiff extends Beautifier
|
||||||
lang = "handlebars"
|
lang = "handlebars"
|
||||||
when "SGML"
|
when "SGML"
|
||||||
lang = "markup"
|
lang = "markup"
|
||||||
when "XML", "Visualforce", "SVG"
|
when "XML", "Visualforce", "SVG", "UX Markup"
|
||||||
lang = "xml"
|
lang = "xml"
|
||||||
when "HTML", "Nunjucks", "UX Markup"
|
when "HTML", "Nunjucks", "Coldfusion"
|
||||||
lang = "html"
|
lang = "html"
|
||||||
when "JavaScript"
|
when "JavaScript"
|
||||||
lang = "javascript"
|
lang = "javascript"
|
||||||
|
@ -127,8 +125,7 @@ module.exports = class PrettyDiff extends Beautifier
|
||||||
|
|
||||||
# Beautify
|
# Beautify
|
||||||
@verbose('prettydiff', options)
|
@verbose('prettydiff', options)
|
||||||
output = prettydiff.api(options)
|
result = prettydiff(options)
|
||||||
result = output[0]
|
|
||||||
|
|
||||||
# Return beautified text
|
# Return beautified text
|
||||||
resolve(result)
|
resolve(result)
|
||||||
|
|
|
@ -10,7 +10,7 @@ module.exports = class VueBeautifier extends Beautifier
|
||||||
|
|
||||||
beautify: (text, language, options) ->
|
beautify: (text, language, options) ->
|
||||||
return new @Promise((resolve, reject) =>
|
return new @Promise((resolve, reject) =>
|
||||||
prettydiff = require("prettydiff")
|
prettydiff = require("prettydiff2")
|
||||||
_ = require('lodash')
|
_ = require('lodash')
|
||||||
regexp = /(^<(template|script|style)[^>]*>)((\s|\S)*?)^<\/\2>/gim
|
regexp = /(^<(template|script|style)[^>]*>)((\s|\S)*?)^<\/\2>/gim
|
||||||
|
|
||||||
|
@ -37,14 +37,14 @@ module.exports = class VueBeautifier extends Beautifier
|
||||||
lang: "scss"
|
lang: "scss"
|
||||||
mode: "beautify"
|
mode: "beautify"
|
||||||
)
|
)
|
||||||
prettydiff.api(options)[0]
|
prettydiff(options)
|
||||||
when "less"
|
when "less"
|
||||||
options = _.merge(options,
|
options = _.merge(options,
|
||||||
source: text
|
source: text
|
||||||
lang: "less"
|
lang: "less"
|
||||||
mode: "beautify"
|
mode: "beautify"
|
||||||
)
|
)
|
||||||
prettydiff.api(options)[0]
|
prettydiff(options)
|
||||||
when undefined
|
when undefined
|
||||||
require("js-beautify").css(text, options)
|
require("js-beautify").css(text, options)
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue