summaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorMatthias Bartelmeß <mba@fourplusone.de>2012-04-07 01:05:25 +0200
committerMatthias Bartelmeß <mba@fourplusone.de>2012-04-07 01:05:25 +0200
commit0340c87996655b3953d94a9b9a38bb92428aa341 (patch)
tree6559380ec336d018fcf8887e7e44030fe7dcb538 /src/node
parent7418f08dc788b2f8a405fc20d73b088ee4413e85 (diff)
downloadetherpad-lite-0340c87996655b3953d94a9b9a38bb92428aa341.zip
Pad message handler detects lineattributemakers by asking Attribute manager
Diffstat (limited to 'src/node')
-rw-r--r--src/node/handler/PadMessageHandler.js10
1 files changed, 8 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);