diff --git a/platform/platform-impl/src/com/intellij/notification/EventLog.java b/platform/platform-impl/src/com/intellij/notification/EventLog.java
index 310e5544c0e8..0ba18358cf37 100644
--- a/platform/platform-impl/src/com/intellij/notification/EventLog.java
+++ b/platform/platform-impl/src/com/intellij/notification/EventLog.java
@@ -46,6 +46,7 @@ import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;
+import com.intellij.util.containers.CollectionFactory;
import com.intellij.util.containers.hash.LinkedHashMap;
import com.intellij.util.text.CharArrayUtil;
import org.jetbrains.annotations.NonNls;
@@ -58,6 +59,7 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.regex.Matcher;
@@ -74,6 +76,7 @@ public class EventLog implements Notifications {
private static final String A_CLOSING = "";
private static final Pattern TAG_PATTERN = Pattern.compile("<[^>]*>");
private static final Pattern A_PATTERN = Pattern.compile("]* )?href=[\"\']([^>]*)[\"\'][^>]*>");
+ private static final Set ", "
", "", "
", "
".equals(tagStart) ||
- "".equals(tagStart) ||
- "
".equals(tagStart) || - "
".equals(tagStart)) { + if (NEW_LINES.contains(tagStart)) { lineSeparators.add(document.createRangeMarker(TextRange.from(document.getTextLength(), 0))); } else if (!"".equals(tagStart) && !"".equals(tagStart) && !"".equals(tagStart) && !"".equals(tagStart)) { @@ -219,7 +218,7 @@ public class EventLog implements Notifications { if (offset < document.getTextLength()) { boolean spaceAfter = Character.isWhitespace(document.getCharsSequence().charAt(offset)); int next = CharArrayUtil.shiftForward(document.getCharsSequence(), offset, " \t"); - if (next < document.getTextLength() && Character.isUpperCase(document.getCharsSequence().charAt(next))) { + if (next < document.getTextLength() && !Character.isLowerCase(document.getCharsSequence().charAt(next))) { document.insertString(offset, (spaceBefore ? "" : " ") + "//" + (spaceAfter ? "" : " ")); continue; } diff --git a/platform/platform-tests/testSrc/com/intellij/notification/EventLogTest.groovy b/platform/platform-tests/testSrc/com/intellij/notification/EventLogTest.groovy index e15a4d732592..5c0c049b42a9 100644 --- a/platform/platform-tests/testSrc/com/intellij/notification/EventLogTest.groovy +++ b/platform/platform-tests/testSrc/com/intellij/notification/EventLogTest.groovy @@ -68,4 +68,10 @@ class EventLogTest extends LightPlatformTestCase { assert entry.message == 'link: content (show balloon)' } + public void testVariousNewlines() throws Exception { + assert EventLog.formatForLog(new Notification("xxx", 'title', "foo