{"issue":{"created_at":"2011-12-02T08:56:48Z","state":"open","updated_at":"2011-12-04T13:50:48Z","comments":4,"user":{"gravatar_id":"dcdb74ac035cf64ec0885d997bedb70b","id":864824,"url":"https://api.github.com/users/pdobrev","avatar_url":"https://secure.gravatar.com/avatar/dcdb74ac035cf64ec0885d997bedb70b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"pdobrev"},"body":"https://github.com/Pita/etherpad-lite/blob/master/node/utils/Changeset.js#L1166\r\n\r\nsplitAttributionLines assumes that if there's one new line in a given op, it will be at the end of the string and will add it as a separate attribution line.\r\n\r\nFor example, if you have the following op in a changeset: \r\nLine1\\n*some text*\r\n\r\nit will get pushed as one attribution line, instead of adding Line1 as one line and *some text* to the next.\r\n\r\nI am not sure if you can have this scenario is regular etherpad usage, probably not. I was using etherpad changesets and it's exportHtml functionality for a project of mine, when I bumped into this issue.\r\n\r\nChanging the if block to the following fixed it for me:\r\n\r\n    if (numLines == 1) {\r\n      var newlineEnd = text.indexOf('\\n', pos) + 1;\r\n      if (newlineEnd != pos + numChars) {\r\n          // newline not at the end\r\n          op.chars = newlineEnd - pos;\r\n          op.lines = 1;\r\n          appendOp(op);\r\n          numChars -= op.chars;\r\n\r\n          op.chars = numChars;\r\n          op.lines = 0;\r\n      } else {\r\n          op.chars = numChars;\r\n          op.lines = 1;\r\n      }\r\n    }\r\n\r\n","assignee":null,"labels":[],"id":2425150,"number":262,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"Changset.splitAttributionLines assumes a new line at the end of the string when there are new lines in the op","closed_at":null,"html_url":"https://github.com/Pita/etherpad-lite/issues/262","url":"https://api.github.com/repos/Pita/etherpad-lite/issues/262","milestone":null},"action":"created","comment":{"created_at":"2011-12-04T13:50:48Z","updated_at":"2011-12-04T13:50:48Z","user":{"gravatar_id":"eb0f2f4a6272441d91c2d8cc330b563d","id":231810,"url":"https://api.github.com/users/Pita","avatar_url":"https://secure.gravatar.com/avatar/eb0f2f4a6272441d91c2d8cc330b563d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"Pita"},"body":"@pdobrev Can you come to the #etherpad-lite-dev irc channel and tell me how you created them by hand?","id":3006568,"url":"https://api.github.com/repos/Pita/etherpad-lite/issues/comments/3006568"}}