Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

render blank lines as blank lines (creeping markup)

  • Loading branch information...
commit b310839ae20565126a48a2707014ea3b3d7207f3 1 parent b0809c3
@WardCunningham authored
View
13 client/client.js
@@ -1586,7 +1586,18 @@ require.define("/lib/plugin.coffee",function(require,module,exports,__dirname,__
window.plugins = {
paragraph: {
emit: function(div, item) {
- return div.append("<p>" + (wiki.resolveLinks(item.text)) + "</p>");
+ var text, _i, _len, _ref, _results;
+ _ref = item.text.split(/\n\n+/);
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ text = _ref[_i];
+ if (text.match(/\S/)) {
+ _results.push(div.append("<p>" + (wiki.resolveLinks(text)) + "</p>"));
+ } else {
+ _results.push(void 0);
+ }
+ }
+ return _results;
},
bind: function(div, item) {
return div.dblclick(function() {
View
4 client/lib/plugin.coffee
@@ -55,7 +55,9 @@ wiki.registerPlugin = (pluginName,pluginFn)->
window.plugins =
paragraph:
- emit: (div, item) -> div.append "<p>#{wiki.resolveLinks(item.text)}</p>"
+ emit: (div, item) ->
+ for text in item.text.split /\n\n+/
+ div.append "<p>#{wiki.resolveLinks(text)}</p>" if text.match /\S/
bind: (div, item) ->
div.dblclick -> wiki.textEditor div, item, null, true
image:
View
13 client/test/testclient.js
@@ -1804,7 +1804,18 @@ require.define("/lib/plugin.coffee",function(require,module,exports,__dirname,__
window.plugins = {
paragraph: {
emit: function(div, item) {
- return div.append("<p>" + (wiki.resolveLinks(item.text)) + "</p>");
+ var text, _i, _len, _ref, _results;
+ _ref = item.text.split(/\n\n+/);
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ text = _ref[_i];
+ if (text.match(/\S/)) {
+ _results.push(div.append("<p>" + (wiki.resolveLinks(text)) + "</p>"));
+ } else {
+ _results.push(void 0);
+ }
+ }
+ return _results;
},
bind: function(div, item) {
return div.dblclick(function() {
Please sign in to comment.
Something went wrong with that request. Please try again.