diff options
-rw-r--r-- | src/node/handler/PadMessageHandler.js | 10 | ||||
-rw-r--r-- | src/static/js/AttributeManager.js | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 866edeb0..ecf79492 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -24,6 +24,7 @@ var async = require("async"); var padManager = require("../db/PadManager"); var Changeset = require("ep_etherpad-lite/static/js/Changeset"); var AttributePool = require("ep_etherpad-lite/static/js/AttributePool"); +var AttributeManager = require("ep_etherpad-lite/static/js/AttributePool"); var authorManager = require("../db/AuthorManager"); var readOnlyManager = require("../db/ReadOnlyManager"); var settings = require('../utils/Settings'); @@ -31,6 +32,7 @@ var securityManager = require("../db/SecurityManager"); var plugins = require("ep_etherpad-lite/static/js/pluginfw/plugins.js"); var log4js = require('log4js'); var messageLogger = log4js.getLogger("message"); +var _ = require('underscore'); /** * A associative array that translates a session to a pad @@ -591,8 +593,12 @@ function _correctMarkersInPad(atext, apool) { var offset = 0; while (iter.hasNext()) { var op = iter.next(); - var listValue = Changeset.opAttributeValue(op, 'list', apool); - if (listValue) { + + var hasMarker = _.find(AttributeManager.lineAttributes, function(attribute){ + return Changeset.opAttributeValue(op, attribute, apool); + }) !== undefined; + + if (hasMarker) { for(var i=0;i<op.chars;i++) { if (offset > 0 && text.charAt(offset-1) != '\n') { badMarkers.push(offset); diff --git a/src/static/js/AttributeManager.js b/src/static/js/AttributeManager.js index c6351e86..8359b1c1 100644 --- a/src/static/js/AttributeManager.js +++ b/src/static/js/AttributeManager.js @@ -29,6 +29,8 @@ var AttributeManager = function(rep, applyChangesetCallback) // it will be considered as a line marker }; +AttributeManager.lineAttributes = lineAttributes; + AttributeManager.prototype = _(AttributeManager.prototype).extend({ applyChangeset: function(changeset){ |