Browse Source

Merge pull request #7 from johndalton/issue-6

Wrap long lines and preserve newlines
Jesse Cardone 3 years ago
parent
commit
693446f422
1 changed files with 2 additions and 1 deletions
  1. 2 1
      index.html

+ 2 - 1
index.html

@@ -34,7 +34,7 @@
 			height: auto;
 		}
 		.txt{
-			white-space: pre;
+			white-space: pre-wrap;
 			border: 1px solid #ddd;
 			border-radius: 4px;
 			padding: 14px;
@@ -178,6 +178,7 @@ You can view the source code <a href="https://github.com/Jessecar96/hangouts-rea
 					// Get message
 					for(msg_key in convo_event['chat_message']['message_content']['segment']){
 						var segment = convo_event['chat_message']['message_content']['segment'][msg_key];
+						if(segment['type'] == 'LINE_BREAK') message += "\n";
 						if(!segment['text']) continue;
 						message += twemoji.parse(segment['text']);
 					}