From eaeb5f59b4cb8a9d64f181c63d5e9433cb19e0e7 Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 15:11:26 -0400 Subject: [PATCH 01/15] breakline change --- .gitignore | 2 ++ lib/html2jade.coffee | 7 +++++++ lib/html2jade.js | 5 +++++ test/data/breakline.html | 10 ++++++++++ test/data/breakline.jade | 11 +++++++++++ 5 files changed, 35 insertions(+) create mode 100644 test/data/breakline.html create mode 100644 test/data/breakline.jade diff --git a/.gitignore b/.gitignore index bf491f1..5aac859 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ attic node_modules .c9/ temp +.idea/ +*.iml diff --git a/lib/html2jade.coffee b/lib/html2jade.coffee index 0b37b4c..956223b 100755 --- a/lib/html2jade.coffee +++ b/lib/html2jade.coffee @@ -207,6 +207,8 @@ class Converter @writer = @options.writer ? new Writer(@options) document: (document, output) -> + + if document.doctype? doctype = document.doctype docTypeName = undefined @@ -219,6 +221,9 @@ class Converter else if doctype.name? and doctype.name.toLowerCase() is 'html' docTypeName = 'html' if docTypeName? + output.writeln 'mixin bbr()' + output.writeln ' | ' + output.writeln ' |
' output.writeln 'doctype ' + docTypeName if document.documentElement @@ -250,6 +255,8 @@ class Converter else if tagName is 'conditional' output.writeln '//' + node.getAttribute('condition') @children node, output + else if tagName is 'br' + output.writeln '+bbr()' else if ['pre'].indexOf(tagName) isnt -1 # HACK: workaround jade's wonky PRE handling output.writeln tagHead + tagAttr + '.' diff --git a/lib/html2jade.js b/lib/html2jade.js index 831f045..3447a77 100644 --- a/lib/html2jade.js +++ b/lib/html2jade.js @@ -331,6 +331,9 @@ docTypeName = 'html'; } if (docTypeName != null) { + output.writeln('mixin bbr()'); + output.writeln(' | '); + output.writeln(' |
'); output.writeln('doctype ' + docTypeName); } } @@ -369,6 +372,8 @@ } else if (tagName === 'conditional') { output.writeln('//' + node.getAttribute('condition')); return this.children(node, output); + } else if (tagName === 'br') { + return output.writeln('+bbr()'); } else if (['pre'].indexOf(tagName) !== -1) { output.writeln(tagHead + tagAttr + '.'); output.enter(); diff --git a/test/data/breakline.html b/test/data/breakline.html new file mode 100644 index 0000000..15642a3 --- /dev/null +++ b/test/data/breakline.html @@ -0,0 +1,10 @@ + + + + +

Hi

+ +
+

Done

+ + \ No newline at end of file diff --git a/test/data/breakline.jade b/test/data/breakline.jade new file mode 100644 index 0000000..64ff9c1 --- /dev/null +++ b/test/data/breakline.jade @@ -0,0 +1,11 @@ +mixin bbr() + | + |
+ +doctype html +html + head + body + p Hi + +bbr() + p Done \ No newline at end of file From f1862eaa568cfda3808fff1c77dbace76abe3a63 Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 15:14:38 -0400 Subject: [PATCH 02/15] more breakline changes --- .gitignore | 1 + lib/html2jade.coffee | 1 + lib/html2jade.js | 219 ++++++++++++++++++++------------------- test/data/breakline.jade | 2 +- 4 files changed, 117 insertions(+), 106 deletions(-) diff --git a/.gitignore b/.gitignore index 5aac859..80fd45c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ node_modules temp .idea/ *.iml +*.js.map diff --git a/lib/html2jade.coffee b/lib/html2jade.coffee index 956223b..a70b640 100755 --- a/lib/html2jade.coffee +++ b/lib/html2jade.coffee @@ -224,6 +224,7 @@ class Converter output.writeln 'mixin bbr()' output.writeln ' | ' output.writeln ' |
' + output.writeln '' output.writeln 'doctype ' + docTypeName if document.documentElement diff --git a/lib/html2jade.js b/lib/html2jade.js index 3447a77..c02a674 100644 --- a/lib/html2jade.js +++ b/lib/html2jade.js @@ -1,8 +1,8 @@ -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.10.0 (function() { var Converter, Ent, FS, Output, Parser, Path, StreamOutput, StringOutput, Writer, applyOptions, doNotEncode, entOptions, isNode, isValidJadeClassName, isValidJadeId, nspaces, publicIdDocTypeNames, scope, systemIdDocTypeNames, useTabs, validJadeClassRegExp, validJadeIdRegExp, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; isNode = false; @@ -36,8 +36,8 @@ validJadeClassRegExp = /^[\w\-]+$/; Parser = (function() { - function Parser(options) { - this.options = options != null ? options : {}; + function Parser(options1) { + this.options = options1 != null ? options1 : {}; if (isNode) { this.jsdom = require('jsdom-little'); } @@ -78,12 +78,12 @@ Writer = (function() { function Writer(options) { - var _ref, _ref1, _ref2; + var ref, ref1, ref2; if (options == null) { options = {}; } - this.wrapLength = (_ref = options.wrapLength) != null ? _ref : 80; - this.scalate = (_ref1 = options.scalate) != null ? _ref1 : false; + this.wrapLength = (ref = options.wrapLength) != null ? ref : 80; + this.scalate = (ref1 = options.scalate) != null ? ref1 : false; this.attrSep = this.scalate || options.noattrcomma ? ' ' : ', '; if (options.double) { this.attrQuote = '"'; @@ -93,7 +93,7 @@ this.nonAttrQuote = '"'; } this.attrQuoteEscaped = "\\" + this.attrQuote; - this.noEmptyPipe = (_ref2 = options.noemptypipe) != null ? _ref2 : false; + this.noEmptyPipe = (ref2 = options.noemptypipe) != null ? ref2 : false; } Writer.prototype.tagHead = function(node) { @@ -115,7 +115,7 @@ }; Writer.prototype.tagAttr = function(node, indents) { - var attr, attrName, attrValue, attrs, invalidClassNames, result, _i, _len; + var attr, attrName, attrValue, attrs, invalidClassNames, j, len, result; if (indents == null) { indents = ''; } @@ -124,8 +124,8 @@ return ''; } else { result = []; - for (_i = 0, _len = attrs.length; _i < _len; _i++) { - attr = attrs[_i]; + for (j = 0, len = attrs.length; j < len; j++) { + attr = attrs[j]; if (attr && attr.nodeName) { attrName = attr.nodeName; attrValue = attr.nodeValue; @@ -164,8 +164,8 @@ }; Writer.prototype.tagText = function(node) { - var data, _ref; - if (((_ref = node.firstChild) != null ? _ref.nodeType : void 0) !== 3) { + var data, ref; + if (((ref = node.firstChild) != null ? ref.nodeType : void 0) !== 3) { return null; } else if (node.firstChild !== node.lastChild) { return null; @@ -180,60 +180,61 @@ }; Writer.prototype.forEachChild = function(parent, cb) { - var child, _results; + var child, results; if (parent) { child = parent.firstChild; - _results = []; + results = []; while (child) { cb(child); - _results.push(child = child.nextSibling); + results.push(child = child.nextSibling); } - return _results; + return results; } }; Writer.prototype.writeTextContent = function(node, output, options) { - var _this = this; output.enter(); - this.forEachChild(node, function(child) { - return _this.writeText(child, output, options); - }); + this.forEachChild(node, (function(_this) { + return function(child) { + return _this.writeText(child, output, options); + }; + })(this)); return output.leave(); }; Writer.prototype.writeText = function(node, output, options) { - var data, lines, - _this = this; + var data, lines; if (node.nodeType === 3) { data = node.data || ''; if (data.length > 0) { lines = data.split(/\r|\n/); - return lines.forEach(function(line) { - return _this.writeTextLine(node, line, output, options); - }); + return lines.forEach((function(_this) { + return function(line) { + return _this.writeTextLine(node, line, output, options); + }; + })(this)); } } }; Writer.prototype.writeTextLine = function(node, line, output, options) { - var encodeEntityRef, escapeBackslash, lines, pipe, prefix, trim, wrap, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, - _this = this; + var encodeEntityRef, escapeBackslash, lines, pipe, prefix, ref, ref1, ref2, ref3, ref4, ref5, ref6, trim, wrap; if (options == null) { options = {}; } - pipe = (_ref = options.pipe) != null ? _ref : true; - trim = (_ref1 = options.trim) != null ? _ref1 : false; - wrap = (_ref2 = options.wrap) != null ? _ref2 : true; - encodeEntityRef = (_ref3 = options.encodeEntityRef) != null ? _ref3 : false; - escapeBackslash = (_ref4 = options.escapeBackslash) != null ? _ref4 : false; + pipe = (ref = options.pipe) != null ? ref : true; + trim = (ref1 = options.trim) != null ? ref1 : false; + wrap = (ref2 = options.wrap) != null ? ref2 : true; + encodeEntityRef = (ref3 = options.encodeEntityRef) != null ? ref3 : false; + escapeBackslash = (ref4 = options.escapeBackslash) != null ? ref4 : false; if (pipe && this.noEmptyPipe && line.trim().length === 0) { return; } prefix = pipe ? '| ' : ''; - if ((node != null ? (_ref5 = node.previousSibling) != null ? _ref5.nodeType : void 0 : void 0) !== 1) { + if ((node != null ? (ref5 = node.previousSibling) != null ? ref5.nodeType : void 0 : void 0) !== 1) { line = line.trimLeft(); } - if ((node != null ? (_ref6 = node.nextSibling) != null ? _ref6.nodeType : void 0 : void 0) !== 1) { + if ((node != null ? (ref6 = node.nextSibling) != null ? ref6.nodeType : void 0 : void 0) !== 1) { line = line.trimRight(); } if (line) { @@ -250,9 +251,11 @@ if (lines.length === 1) { return output.writeln(prefix + line); } else { - return lines.forEach(function(line) { - return _this.writeTextLine(node, line, output, options); - }); + return lines.forEach((function(_this) { + return function(line) { + return _this.writeTextLine(node, line, output, options); + }; + })(this)); } } } @@ -309,11 +312,11 @@ }; Converter = (function() { - function Converter(options) { - var _ref, _ref1; - this.options = options != null ? options : {}; - this.scalate = (_ref = this.options.scalate) != null ? _ref : false; - this.writer = (_ref1 = this.options.writer) != null ? _ref1 : new Writer(this.options); + function Converter(options1) { + var ref, ref1; + this.options = options1 != null ? options1 : {}; + this.scalate = (ref = this.options.scalate) != null ? ref : false; + this.writer = (ref1 = this.options.writer) != null ? ref1 : new Writer(this.options); } Converter.prototype.document = function(document, output) { @@ -334,6 +337,7 @@ output.writeln('mixin bbr()'); output.writeln(' | '); output.writeln(' |
'); + output.writeln(''); output.writeln('doctype ' + docTypeName); } } @@ -348,8 +352,7 @@ }; Converter.prototype.element = function(node, output) { - var firstline, tagAttr, tagHead, tagName, tagText, - _this = this; + var firstline, tagAttr, tagHead, tagName, tagText; if (!(node != null ? node.tagName : void 0)) { return; } @@ -378,24 +381,26 @@ output.writeln(tagHead + tagAttr + '.'); output.enter(); firstline = true; - this.writer.forEachChild(node, function(child) { - var data; - if (child.nodeType === 3) { - data = child.data; - if ((data != null) && data.length > 0) { - if (firstline) { - if (data.search(/\r\n|\r|\n/) === 0) { - data = data.replace(/\r\n|\r|\n/, ''); + this.writer.forEachChild(node, (function(_this) { + return function(child) { + var data; + if (child.nodeType === 3) { + data = child.data; + if ((data != null) && data.length > 0) { + if (firstline) { + if (data.search(/\r\n|\r|\n/) === 0) { + data = data.replace(/\r\n|\r|\n/, ''); + } + data = '\\n' + data; + firstline = false; } - data = '\\n' + data; - firstline = false; + data = data.replace(/\t/g, '\\t'); + data = data.replace(/\r\n|\r|\n/g, '\n' + output.indents); + return output.write(data); } - data = data.replace(/\t/g, '\\t'); - data = data.replace(/\r\n|\r|\n/g, '\n' + output.indents); - return output.write(data); } - } - }); + }; + })(this)); output.writeln(); return output.leave(); } else if (this.options.bodyless && (tagName === 'html' || tagName === 'body')) { @@ -413,35 +418,36 @@ }; Converter.prototype.children = function(parent, output, indent) { - var _this = this; if (indent == null) { indent = true; } if (indent) { output.enter(); } - this.writer.forEachChild(parent, function(child) { - var nodeType; - nodeType = child.nodeType; - if (nodeType === 1) { - return _this.element(child, output); - } else if (nodeType === 3) { - if (parent._nodeName === 'code') { - return _this.text(child, output, { - encodeEntityRef: true, - pipe: true - }); - } else { - return _this.text(child, output, doNotEncode ? { - encodeEntityRef: false - } : { - encodeEntityRef: true - }); + this.writer.forEachChild(parent, (function(_this) { + return function(child) { + var nodeType; + nodeType = child.nodeType; + if (nodeType === 1) { + return _this.element(child, output); + } else if (nodeType === 3) { + if (parent._nodeName === 'code') { + return _this.text(child, output, { + encodeEntityRef: true, + pipe: true + }); + } else { + return _this.text(child, output, doNotEncode ? { + encodeEntityRef: false + } : { + encodeEntityRef: true + }); + } + } else if (nodeType === 8) { + return _this.comment(child, output); } - } else if (nodeType === 8) { - return _this.comment(child, output); - } - }); + }; + })(this)); if (indent) { return output.leave(); } @@ -453,8 +459,7 @@ }; Converter.prototype.comment = function(node, output) { - var condition, data, lines, - _this = this; + var condition, data, lines; condition = node.data.match(/\s*\[(if\s+[^\]]+)\]/); if (!condition) { data = node.data || ''; @@ -464,13 +469,15 @@ output.writeln('//'); output.enter(); lines = data.split(/\r|\n/); - lines.forEach(function(line) { - return _this.writer.writeTextLine(node, line, output, { - pipe: false, - trim: true, - wrap: false - }); - }); + lines.forEach((function(_this) { + return function(line) { + return _this.writer.writeTextLine(node, line, output, { + pipe: false, + trim: true, + wrap: false + }); + }; + })(this)); return output.leave(); } } else { @@ -538,15 +545,15 @@ } Output.prototype.enter = function() { - var i, _i, _results; + var i, j, ref, results; if (useTabs) { return this.indents += '\t'; } else { - _results = []; - for (i = _i = 1; 1 <= nspaces ? _i <= nspaces : _i >= nspaces; i = 1 <= nspaces ? ++_i : --_i) { - _results.push(this.indents += ' '); + results = []; + for (i = j = 1, ref = nspaces; 1 <= ref ? j <= ref : j >= ref; i = 1 <= ref ? ++j : --j) { + results.push(this.indents += ' '); } - return _results; + return results; } }; @@ -574,8 +581,8 @@ })(); - StringOutput = (function(_super) { - __extends(StringOutput, _super); + StringOutput = (function(superClass) { + extend(StringOutput, superClass); function StringOutput() { StringOutput.__super__.constructor.apply(this, arguments); @@ -621,8 +628,8 @@ })(Output); - StreamOutput = (function(_super) { - __extends(StreamOutput, _super); + StreamOutput = (function(superClass) { + extend(StreamOutput, superClass); function StreamOutput(stream) { this.stream = stream; @@ -718,11 +725,11 @@ options.parser = new Parser(options); } return options.parser.parse(html, function(errors, window) { - var output, _ref; + var output, ref; if (errors != null ? errors.length : void 0) { return errors; } else { - output = (_ref = options.output) != null ? _ref : new StringOutput(); + output = (ref = options.output) != null ? ref : new StringOutput(); if (options.converter == null) { options.converter = new Converter(options); } @@ -735,12 +742,12 @@ }; scope.convertDocument = function(document, options, cb) { - var output, _ref; + var output, ref; if (options == null) { options = {}; } applyOptions(options); - output = (_ref = options.output) != null ? _ref : new StringOutput(); + output = (ref = options.output) != null ? ref : new StringOutput(); if (options.converter == null) { options.converter = new Converter(options); } @@ -751,3 +758,5 @@ }; }).call(this); + +//# sourceMappingURL=html2jade.js.map diff --git a/test/data/breakline.jade b/test/data/breakline.jade index 64ff9c1..7e330b1 100644 --- a/test/data/breakline.jade +++ b/test/data/breakline.jade @@ -1,5 +1,5 @@ mixin bbr() - | + | |
doctype html From 50d2de1b0e83de761505f4f0bfa7fa142ae74d85 Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 15:23:13 -0400 Subject: [PATCH 03/15] br changes --- lib/html2jade.coffee | 1 - lib/html2jade.js | 1 - test/data/breakline.html | 1 - test/data/breakline.jade | 1 - 4 files changed, 4 deletions(-) diff --git a/lib/html2jade.coffee b/lib/html2jade.coffee index a70b640..5c1ba66 100755 --- a/lib/html2jade.coffee +++ b/lib/html2jade.coffee @@ -222,7 +222,6 @@ class Converter docTypeName = 'html' if docTypeName? output.writeln 'mixin bbr()' - output.writeln ' | ' output.writeln ' |
' output.writeln '' output.writeln 'doctype ' + docTypeName diff --git a/lib/html2jade.js b/lib/html2jade.js index c02a674..c6d8ba8 100644 --- a/lib/html2jade.js +++ b/lib/html2jade.js @@ -335,7 +335,6 @@ } if (docTypeName != null) { output.writeln('mixin bbr()'); - output.writeln(' | '); output.writeln(' |
'); output.writeln(''); output.writeln('doctype ' + docTypeName); diff --git a/test/data/breakline.html b/test/data/breakline.html index 15642a3..099ff6f 100644 --- a/test/data/breakline.html +++ b/test/data/breakline.html @@ -3,7 +3,6 @@

Hi

-

Done

diff --git a/test/data/breakline.jade b/test/data/breakline.jade index 7e330b1..fdf1fc8 100644 --- a/test/data/breakline.jade +++ b/test/data/breakline.jade @@ -1,5 +1,4 @@ mixin bbr() - | |
doctype html From f8d2fe76e050aaa4e50cdd64f3d3e10c75656f40 Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 15:25:45 -0400 Subject: [PATCH 04/15] br test changes --- test/data/breakline.jade | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/data/breakline.jade b/test/data/breakline.jade index fdf1fc8..9f68d92 100644 --- a/test/data/breakline.jade +++ b/test/data/breakline.jade @@ -4,7 +4,10 @@ mixin bbr() doctype html html head + | body p Hi + | +bbr() - p Done \ No newline at end of file + | + p Done From 6ac47143c0fe6e770cc474c4d31a1de2364b0eaf Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 15:30:03 -0400 Subject: [PATCH 05/15] br changes --- lib/html2jade.coffee | 1 + lib/html2jade.js | 1 + test/data/breakline.html | 7 ++++--- test/data/breakline.jade | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/html2jade.coffee b/lib/html2jade.coffee index 5c1ba66..a70b640 100755 --- a/lib/html2jade.coffee +++ b/lib/html2jade.coffee @@ -222,6 +222,7 @@ class Converter docTypeName = 'html' if docTypeName? output.writeln 'mixin bbr()' + output.writeln ' | ' output.writeln ' |
' output.writeln '' output.writeln 'doctype ' + docTypeName diff --git a/lib/html2jade.js b/lib/html2jade.js index c6d8ba8..c02a674 100644 --- a/lib/html2jade.js +++ b/lib/html2jade.js @@ -335,6 +335,7 @@ } if (docTypeName != null) { output.writeln('mixin bbr()'); + output.writeln(' | '); output.writeln(' |
'); output.writeln(''); output.writeln('doctype ' + docTypeName); diff --git a/test/data/breakline.html b/test/data/breakline.html index 099ff6f..53c9751 100644 --- a/test/data/breakline.html +++ b/test/data/breakline.html @@ -1,9 +1,10 @@ - + -

Hi

-
+

Hi

+ +

Done

\ No newline at end of file diff --git a/test/data/breakline.jade b/test/data/breakline.jade index 9f68d92..35cd5e0 100644 --- a/test/data/breakline.jade +++ b/test/data/breakline.jade @@ -1,4 +1,5 @@ mixin bbr() + | |
doctype html From d1a390a81436a237704a018fa812264afdacebc2 Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 15:32:23 -0400 Subject: [PATCH 06/15] test data change --- test/data/breakline.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/data/breakline.html b/test/data/breakline.html index 53c9751..8b8af19 100644 --- a/test/data/breakline.html +++ b/test/data/breakline.html @@ -1,10 +1,9 @@ - + -

Hi

- -
+

Hi

+

Done

\ No newline at end of file From e762f994e94baa1c190a2bc880521db852a29edd Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 15:34:09 -0400 Subject: [PATCH 07/15] update bbr mixin in test cases --- test/data/attr-multiline.jade | 6 +----- test/data/conditional2.jade | 10 +++++++--- test/data/conditional3.jade | 4 ++++ test/data/html5boilerplate.jade | 4 ++++ test/data/pre1.jade | 4 ++++ test/data/pre2.jade | 4 ++++ test/data/pre3.jade | 4 ++++ test/data/test.jade | 4 ++++ 8 files changed, 32 insertions(+), 8 deletions(-) diff --git a/test/data/attr-multiline.jade b/test/data/attr-multiline.jade index 16f1c0b..8e00fc9 100644 --- a/test/data/attr-multiline.jade +++ b/test/data/attr-multiline.jade @@ -1,7 +1,3 @@ html body - img(src='img/close_button.png', height='16', width='16', alt='Home', onclick="\ - mwl.switchClass('#search_title', 'show_title_search', 'show_title_main');\ - mwl.setGroupTarget('#navigateToggle', '#home', 'show', 'hide');\ - mwl.switchClass('#slider', 'show_miniapp', 'show_main');\ - mwl.scrollTo('#main');") + img(src='img/close_button.png', height='16', width='16', alt='Home', onclick="\ mwl.switchClass('#search_title', 'show_title_search', 'show_title_main');\ mwl.setGroupTarget('#navigateToggle', '#home', 'show', 'hide');\ mwl.switchClass('#slider', 'show_miniapp', 'show_main');\ mwl.scrollTo('#main');") diff --git a/test/data/conditional2.jade b/test/data/conditional2.jade index 53fa109..5eb210c 100644 --- a/test/data/conditional2.jade +++ b/test/data/conditional2.jade @@ -1,3 +1,7 @@ +mixin bbr() + | + |
+ doctype html // paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ //if lt IE 7 @@ -119,17 +123,17 @@ html.no-js(lang='en') ul.disc li a(href='http://foundation.zurb.com/docs') Foundation Documentation - br + +bbr() | Everything you need to know about using the framework. | li a(href='http://github.com/zurb/foundation') Foundation on Github - br + +bbr() | Latest code, issue reports, feature requests and more. | li a(href='http://twitter.com/foundationzurb') @foundationzurb - br + +bbr() | Ping us on Twitter if you have questions. If you build something with this we'd love to see it (and send you a totally boss sticker). // Included JS Files script(src='vendor/assets/javascripts/foundation/jquery.js') diff --git a/test/data/conditional3.jade b/test/data/conditional3.jade index 9acd89c..e03ac91 100644 --- a/test/data/conditional3.jade +++ b/test/data/conditional3.jade @@ -1,3 +1,7 @@ +mixin bbr() + | + |
+ doctype html //if lt IE 7 html.no-js.lt-ie9.lt-ie8.lt-ie7 diff --git a/test/data/html5boilerplate.jade b/test/data/html5boilerplate.jade index 1d01242..f412869 100644 --- a/test/data/html5boilerplate.jade +++ b/test/data/html5boilerplate.jade @@ -1,3 +1,7 @@ +mixin bbr() + | + |
+ doctype html //if lt IE 7 html.no-js.ie6.oldie(lang='en') diff --git a/test/data/pre1.jade b/test/data/pre1.jade index bc63f3f..cb44d49 100644 --- a/test/data/pre1.jade +++ b/test/data/pre1.jade @@ -1,3 +1,7 @@ +mixin bbr() + | + |
+ doctype html html head diff --git a/test/data/pre2.jade b/test/data/pre2.jade index 9300ff9..b4bf01d 100644 --- a/test/data/pre2.jade +++ b/test/data/pre2.jade @@ -1,3 +1,7 @@ +mixin bbr() + | + |
+ doctype html html head diff --git a/test/data/pre3.jade b/test/data/pre3.jade index edaa5d1..50e7a00 100644 --- a/test/data/pre3.jade +++ b/test/data/pre3.jade @@ -1,3 +1,7 @@ +mixin bbr() + | + |
+ doctype html html head diff --git a/test/data/test.jade b/test/data/test.jade index 9300ff9..b4bf01d 100644 --- a/test/data/test.jade +++ b/test/data/test.jade @@ -1,3 +1,7 @@ +mixin bbr() + | + |
+ doctype html html head From 250b1f19d9cfc70acf4008c6b9bb1ba6f211c570 Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 16:13:22 -0400 Subject: [PATCH 08/15] trying to fix linefeeds --- test/data/attr-multiline.jade | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/data/attr-multiline.jade b/test/data/attr-multiline.jade index 8e00fc9..5641143 100644 --- a/test/data/attr-multiline.jade +++ b/test/data/attr-multiline.jade @@ -1,3 +1,7 @@ -html - body - img(src='img/close_button.png', height='16', width='16', alt='Home', onclick="\ mwl.switchClass('#search_title', 'show_title_search', 'show_title_main');\ mwl.setGroupTarget('#navigateToggle', '#home', 'show', 'hide');\ mwl.switchClass('#slider', 'show_miniapp', 'show_main');\ mwl.scrollTo('#main');") +html + body + img(src='img/close_button.png', height='16', width='16', alt='Home', onclick="\ + mwl.switchClass('#search_title', 'show_title_search', 'show_title_main');\ + mwl.setGroupTarget('#navigateToggle', '#home', 'show', 'hide');\ + mwl.switchClass('#slider', 'show_miniapp', 'show_main');\ + mwl.scrollTo('#main');") From deaeb68aa5371cab459cefd84b8f81b029a57780 Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 16:16:35 -0400 Subject: [PATCH 09/15] trying to fix travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 55837a1..4064c1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ language: node_js node_js: - - "0.10" + - "v5.1.1" From 6df28d08ca72ae11f7dc6457d0f78e9d4f7cf3f1 Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 17:55:22 -0400 Subject: [PATCH 10/15] broken travis tests --- test/{data => }/attr-multiline.html | 0 test/{data => }/attr-multiline.jade | 14 +++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) rename test/{data => }/attr-multiline.html (100%) rename test/{data => }/attr-multiline.jade (97%) diff --git a/test/data/attr-multiline.html b/test/attr-multiline.html similarity index 100% rename from test/data/attr-multiline.html rename to test/attr-multiline.html diff --git a/test/data/attr-multiline.jade b/test/attr-multiline.jade similarity index 97% rename from test/data/attr-multiline.jade rename to test/attr-multiline.jade index 5641143..16f1c0b 100644 --- a/test/data/attr-multiline.jade +++ b/test/attr-multiline.jade @@ -1,7 +1,7 @@ -html - body - img(src='img/close_button.png', height='16', width='16', alt='Home', onclick="\ - mwl.switchClass('#search_title', 'show_title_search', 'show_title_main');\ - mwl.setGroupTarget('#navigateToggle', '#home', 'show', 'hide');\ - mwl.switchClass('#slider', 'show_miniapp', 'show_main');\ - mwl.scrollTo('#main');") +html + body + img(src='img/close_button.png', height='16', width='16', alt='Home', onclick="\ + mwl.switchClass('#search_title', 'show_title_search', 'show_title_main');\ + mwl.setGroupTarget('#navigateToggle', '#home', 'show', 'hide');\ + mwl.switchClass('#slider', 'show_miniapp', 'show_main');\ + mwl.scrollTo('#main');") From 52b1f00eaced1d7b1b501572dd913236c14dd875 Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 19:03:42 -0400 Subject: [PATCH 11/15] fix npm tests and mocha --- test/{ => data}/attr-multiline.html | 0 test/{ => data}/attr-multiline.jade | 0 test/mocha.opts | 1 + 3 files changed, 1 insertion(+) rename test/{ => data}/attr-multiline.html (100%) rename test/{ => data}/attr-multiline.jade (100%) diff --git a/test/attr-multiline.html b/test/data/attr-multiline.html similarity index 100% rename from test/attr-multiline.html rename to test/data/attr-multiline.html diff --git a/test/attr-multiline.jade b/test/data/attr-multiline.jade similarity index 100% rename from test/attr-multiline.jade rename to test/data/attr-multiline.jade diff --git a/test/mocha.opts b/test/mocha.opts index 5ab5cf2..5deed1c 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -1,4 +1,5 @@ --reporter spec --ui bdd --timeout 20000 +--require coffee-script/register --compilers coffee:coffee-script From fc7f182fdcb4ec7b89d0a900391ac964a5053cdb Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 21:16:48 -0400 Subject: [PATCH 12/15] adding attributes to force line feeds for testing purposes --- test/data/.gitattributes | 2 ++ test/data/html5boilerplate.html | 0 2 files changed, 2 insertions(+) create mode 100644 test/data/.gitattributes mode change 100755 => 100644 test/data/html5boilerplate.html diff --git a/test/data/.gitattributes b/test/data/.gitattributes new file mode 100644 index 0000000..6fee394 --- /dev/null +++ b/test/data/.gitattributes @@ -0,0 +1,2 @@ +*.jade -crlf +*.html -crlf \ No newline at end of file diff --git a/test/data/html5boilerplate.html b/test/data/html5boilerplate.html old mode 100755 new mode 100644 From 77aa18233765fadc1943341498cfee9806bdafb6 Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 21:22:59 -0400 Subject: [PATCH 13/15] fix coffeescript version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4132355..a0367f8 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "devDependencies": { "async": "*", "mocha": "*", - "coffee-script": "~1.6.3" + "coffee-script": "~1.10.0" }, "engines": { "node": ">= 0.4.0" From ebbe06419f61ce9de8724af7561bce0a93553647 Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 21:27:31 -0400 Subject: [PATCH 14/15] trying to fix line feeds --- test/data/.gitattributes => .gitattributes | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/data/.gitattributes => .gitattributes (100%) diff --git a/test/data/.gitattributes b/.gitattributes similarity index 100% rename from test/data/.gitattributes rename to .gitattributes From 6e30de32603d67afa0c083cb2da8f12be5511d54 Mon Sep 17 00:00:00 2001 From: Sebastian Audet Date: Sat, 2 Apr 2016 22:06:38 -0400 Subject: [PATCH 15/15] try again to fix --- .gitattributes | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 6fee394..a21d6eb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ -*.jade -crlf -*.html -crlf \ No newline at end of file +*.jade text eol=lf +*.html text eol=lf \ No newline at end of file