From afd2b46ea4cac3f103d081174b30bd85bc253dd8 Mon Sep 17 00:00:00 2001 From: Jake Luer Date: Sat, 3 Jul 2010 19:18:30 -0700 Subject: [PATCH 1/3] Switch to markdown-js library to prevent bleeding --- .gitmodules | 5 ++++- deps/markdown-js | 1 + lib/jade.js | 2 +- support/expresso | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) create mode 160000 deps/markdown-js diff --git a/.gitmodules b/.gitmodules index 70f40a7a2..a7f3b1265 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "support/expresso"] path = support/expresso - url = git://github.com/visionmedia/expresso.git \ No newline at end of file + url = git://github.com/visionmedia/expresso.git +[submodule "deps/markdown-js"] + path = deps/markdown-js + url = http://github.com/evilstreak/markdown-js.git diff --git a/deps/markdown-js b/deps/markdown-js new file mode 160000 index 000000000..805b0a69e --- /dev/null +++ b/deps/markdown-js @@ -0,0 +1 @@ +Subproject commit 805b0a69e1b357dcf2c4d54486dbcd7d6ac3d427 diff --git a/lib/jade.js b/lib/jade.js index 57fb4084a..a1d29cec1 100644 --- a/lib/jade.js +++ b/lib/jade.js @@ -114,7 +114,7 @@ var filters = exports.filters = { markdown: function(str){ str = str.replace(/\\n/g, '\n'); - return require('markdown').parse(str).replace(/\n/g, '\\n'); + return require('../deps/markdown-js/lib/markdown').toHTML(str).replace(/\n/g, '\\n').replace(/'/g,'''); } }; diff --git a/support/expresso b/support/expresso index 4d09998d7..1d0a1b7d1 160000 --- a/support/expresso +++ b/support/expresso @@ -1 +1 @@ -Subproject commit 4d09998d73effb84d676840ddd70b73bf137feda +Subproject commit 1d0a1b7d1ddd0ff488ef702fb3c507b20b6caef5 From d2be31489bc09afc464e18d43a77294633799637 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Mon, 5 Jul 2010 08:49:36 -0700 Subject: [PATCH 2/3] Fixed :markdown tests --- test/filters.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/filters.test.js b/test/filters.test.js index 26412ca59..cd1da3216 100644 --- a/test/filters.test.js +++ b/test/filters.test.js @@ -32,7 +32,7 @@ module.exports = { 'test :markdown filter': function(assert){ assert.equal( - '

foo

\n\n\n', + '

foo

\n\n', render(':markdown\n | #foo\n | - bar\n | - baz')) }, From edc190bdf5507c4b2665e13194de73b7fbb9505e Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Thu, 8 Jul 2010 08:30:20 -0700 Subject: [PATCH 3/3] Fixed markdown support We should only relative require when we are installing the package along with jade. Here we use it for testing, but require that the user has it installed --- .gitmodules | 4 ++-- Makefile | 4 ++-- Readme.md | 6 +++--- lib/jade.js | 2 +- support/expresso | 2 +- deps/markdown-js => support/markdown | 0 6 files changed, 9 insertions(+), 9 deletions(-) rename deps/markdown-js => support/markdown (100%) diff --git a/.gitmodules b/.gitmodules index a7f3b1265..6e5b5727d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "support/expresso"] path = support/expresso url = git://github.com/visionmedia/expresso.git -[submodule "deps/markdown-js"] - path = deps/markdown-js +[submodule "support/markdown"] + path = support/markdown url = http://github.com/evilstreak/markdown-js.git diff --git a/Makefile b/Makefile index b1df67075..656816758 100644 --- a/Makefile +++ b/Makefile @@ -11,10 +11,10 @@ uninstall: rm -f $(LIB_PREFIX)/jade.js test: - @./support/expresso/bin/expresso -I lib test/*.js + @./support/expresso/bin/expresso -I lib -I support/markdown/lib test/*.js test-cov: - @./support/expresso/bin/expresso -I lib --cov test/*.js + @./support/expresso/bin/expresso -I lib -I support/markdown/lib --cov test/*.js api.html: lib/jade.js @dox --title "Jade" \ diff --git a/Readme.md b/Readme.md index 4d256cad2..006f85dd2 100644 --- a/Readme.md +++ b/Readme.md @@ -17,9 +17,9 @@ - supports [Express JS](http://expressjs.com) - no tag prefix - filters - - :sass - - :less - - :markdown + - :sass must have [sass.js](http://github.com/visionmedia/sass.js) installed + - :less must have [less.js](http://github.com/cloudhead/less.js) installed + - :markdown must have [markdown-js](http://github.com/evilstreak/markdown-js) installed - :cdata - :javascript diff --git a/lib/jade.js b/lib/jade.js index a1d29cec1..c22c32b7a 100644 --- a/lib/jade.js +++ b/lib/jade.js @@ -114,7 +114,7 @@ var filters = exports.filters = { markdown: function(str){ str = str.replace(/\\n/g, '\n'); - return require('../deps/markdown-js/lib/markdown').toHTML(str).replace(/\n/g, '\\n').replace(/'/g,'''); + return require('markdown').toHTML(str).replace(/\n/g, '\\n').replace(/'/g,'''); } }; diff --git a/support/expresso b/support/expresso index 1d0a1b7d1..4d09998d7 160000 --- a/support/expresso +++ b/support/expresso @@ -1 +1 @@ -Subproject commit 1d0a1b7d1ddd0ff488ef702fb3c507b20b6caef5 +Subproject commit 4d09998d73effb84d676840ddd70b73bf137feda diff --git a/deps/markdown-js b/support/markdown similarity index 100% rename from deps/markdown-js rename to support/markdown