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:
|
||||
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"
|
||||
|
||||
addons:
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# Next
|
||||
- See [#881](https://github.com/Glavin001/atom-beautify/issues/881). Update to Prettydiff version 2!
|
||||
- ...
|
||||
|
||||
# v0.30.5 (2017-08-11)
|
||||
|
|
|
@ -133,7 +133,7 @@ build_script:
|
|||
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
# 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
|
||||
- echo %PATH%
|
||||
# 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">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
@ -113,6 +113,7 @@
|
|||
.slideIn {
|
||||
.animation(SlideIn, 0.5s);
|
||||
}
|
||||
|
||||
@-webkit-keyframes SlideIn {
|
||||
0% {
|
||||
.transform(translateY(-100%));
|
||||
|
@ -127,6 +128,7 @@
|
|||
display: block;
|
||||
.animation(FadeIn, 0.5s);
|
||||
}
|
||||
|
||||
@-webkit-keyframes FadeIn {
|
||||
0% {
|
||||
opacity: 0;
|
||||
|
@ -140,6 +142,7 @@
|
|||
.slideOut {
|
||||
.animation(SlideOut, 0.5s);
|
||||
}
|
||||
|
||||
@-webkit-keyframes SlideOut {
|
||||
0% {
|
||||
.transform(translateY(0%));
|
||||
|
@ -153,6 +156,7 @@
|
|||
.fadeOut {
|
||||
.animation(FadeOut, 0.5s);
|
||||
}
|
||||
|
||||
@-webkit-keyframes FadeOut {
|
||||
0% {
|
||||
opacity: 1;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
]
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style scoped="scoped">
|
||||
:scope {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* kendo UI */
|
||||
|
||||
@import "variables";
|
||||
|
||||
// slider
|
||||
|
|
|
@ -179,7 +179,7 @@
|
|||
"node-dir": "0.1.17",
|
||||
"node-uuid": "1.4.8",
|
||||
"open": "0.0.5",
|
||||
"prettydiff": "1.16.37",
|
||||
"prettydiff2": "^2.2.7",
|
||||
"pug-beautify": "^0.1.1",
|
||||
"remark": "6.0.1",
|
||||
"season": "6.0.0",
|
||||
|
@ -426,7 +426,7 @@
|
|||
"typescript-formatter",
|
||||
"tidy-markdown",
|
||||
"underscore-plus",
|
||||
"prettydiff"
|
||||
"prettydiff2"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -438,7 +438,7 @@
|
|||
"typescript-formatter",
|
||||
"tidy-markdown",
|
||||
"underscore-plus",
|
||||
"prettydiff"
|
||||
"prettydiff2"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,16 +44,16 @@ describe "BeautifyLanguages", ->
|
|||
|
||||
# Activate all of the languages
|
||||
allLanguages = [
|
||||
"c", "clojure", "coffee-script", "css", "d", "html",
|
||||
"java", "javascript", "json", "less",
|
||||
"mustache", "objective-c", "perl", "php",
|
||||
"python", "ruby", "sass", "sql", "svg",
|
||||
"xml", "csharp", "gfm", "marko",
|
||||
"go", "html-swig", "lua"
|
||||
"c", "clojure", "coffee-script", "css", "csharp", "d",
|
||||
"gfm", "go", "html", "html-swig", "java", "javascript",
|
||||
"json", "less", "lua", "marko", "mustache", "objective-c",
|
||||
"perl", "php", "python", "ruby", "sass", "sql",
|
||||
"svg", "xml"
|
||||
]
|
||||
# All Atom packages that Atom Beautify is dependent on
|
||||
dependentPackages = [
|
||||
'autocomplete-plus'
|
||||
'fuse'
|
||||
# 'linter'
|
||||
# 'atom-typescript' # it logs too much...
|
||||
]
|
||||
|
|
|
@ -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
|
||||
|
@ -81,8 +81,6 @@ module.exports = class PrettyDiff extends Beautifier
|
|||
switch language
|
||||
when "CSV"
|
||||
lang = "csv"
|
||||
when "Coldfusion"
|
||||
lang = "html"
|
||||
when "EJS", "Twig"
|
||||
lang = "ejs"
|
||||
when "ERB"
|
||||
|
@ -91,9 +89,9 @@ module.exports = class PrettyDiff extends Beautifier
|
|||
lang = "handlebars"
|
||||
when "SGML"
|
||||
lang = "markup"
|
||||
when "XML", "Visualforce", "SVG"
|
||||
when "XML", "Visualforce", "SVG", "UX Markup"
|
||||
lang = "xml"
|
||||
when "HTML", "Nunjucks", "UX Markup"
|
||||
when "HTML", "Nunjucks", "Coldfusion"
|
||||
lang = "html"
|
||||
when "JavaScript"
|
||||
lang = "javascript"
|
||||
|
@ -127,8 +125,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]
|
||||
prettydiff(options)
|
||||
when undefined
|
||||
require("js-beautify").css(text, options)
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue