From b2d9f57338b22cb694adae81c7ec7c1467705ce2 Mon Sep 17 00:00:00 2001 From: Luiza Pagliari Date: Thu, 12 Jan 2017 12:31:42 -0200 Subject: [PATCH 1/2] [fix] Consider line attribs of plugins when building changesets When checking the places on text that are identical between content before and after a changeset, we were considering only the standard (Etherpad-core) attributes, and not taking into account attributes created by the plugins. One consequence was that the '*' marker of lines with line attribs were being kept, even when the new lines have different line attribs. See #3118 for more details. Fix #3118. --- src/static/js/ace2_inner.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 0970666eb..f44a6583a 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -1782,9 +1782,9 @@ function Ace2Inner(){ return !!STYLE_ATTRIBS[aname]; } - function isIncorpedAttribute(aname) + function isOtherIncorpedAttribute(aname) { - return ( !! STYLE_ATTRIBS[aname]) || ( !! OTHER_INCORPED_ATTRIBS[aname]); + return !!OTHER_INCORPED_ATTRIBS[aname]; } function insertDomLines(nodeToAddAfter, infoStructs, isTimeUp) @@ -2526,7 +2526,6 @@ function Ace2Inner(){ function doIncorpLineSplice(startLine, deleteCount, newLineEntries, lineAttribs, hints) { - var startOldChar = rep.lines.offsetOfIndex(startLine); var endOldChar = rep.lines.offsetOfIndex(startLine + deleteCount); @@ -2760,7 +2759,7 @@ function Ace2Inner(){ { function incorpedAttribFilter(anum) { - return isStyleAttribute(rep.apool.getAttribKey(anum)); + return !isOtherIncorpedAttribute(rep.apool.getAttribKey(anum)); } function attribRuns(attribs) From 520f257ed19cb410dbbf0fc3017869bd544a8173 Mon Sep 17 00:00:00 2001 From: Luiza Pagliari Date: Thu, 12 Jan 2017 13:04:32 -0200 Subject: [PATCH 2/2] [chore] Use helper plugin when running tests on Travis This plugin allows us to test code related to plugins, like testing issues that only happen when we have plugins using line attribs, for example (see #3118). --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4cdf63837..911ea8bad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ node_js: install: - "bin/installDeps.sh" - "export GIT_HASH=$(git rev-parse --verify --short HEAD)" + - "npm install ep_test_line_attrib" before_script: - "tests/frontend/travis/sauce_tunnel.sh" script: