Skip to content
This repository has been archived by the owner on Feb 14, 2018. It is now read-only.

Commit

Permalink
render blank lines as blank lines (creeping markup)
Browse files Browse the repository at this point in the history
  • Loading branch information
WardCunningham committed Jan 22, 2013
1 parent b0809c3 commit b310839
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
13 changes: 12 additions & 1 deletion client/client.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1586,7 +1586,18 @@ require.define("/lib/plugin.coffee",function(require,module,exports,__dirname,__
window.plugins = { window.plugins = {
paragraph: { paragraph: {
emit: function(div, item) { 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) { bind: function(div, item) {
return div.dblclick(function() { return div.dblclick(function() {
Expand Down
4 changes: 3 additions & 1 deletion client/lib/plugin.coffee
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ wiki.registerPlugin = (pluginName,pluginFn)->


window.plugins = window.plugins =
paragraph: 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) -> bind: (div, item) ->
div.dblclick -> wiki.textEditor div, item, null, true div.dblclick -> wiki.textEditor div, item, null, true
image: image:
Expand Down
13 changes: 12 additions & 1 deletion client/test/testclient.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1804,7 +1804,18 @@ require.define("/lib/plugin.coffee",function(require,module,exports,__dirname,__
window.plugins = { window.plugins = {
paragraph: { paragraph: {
emit: function(div, item) { 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) { bind: function(div, item) {
return div.dblclick(function() { return div.dblclick(function() {
Expand Down

0 comments on commit b310839

Please sign in to comment.