DJF3 / Webex-Message-space-archiver

Archive Cisco Webex Teams Space messages to a single HTML file. Highly configurable (download files/images, sort order, max messages or age, avatars, etc)
Other
55 stars 19 forks source link

Soft returns / newlines are not shown (visually) in HTML output #8

Closed ojchase closed 2 years ago

ojchase commented 2 years ago

Example message from webex:

image

In the JSON output:

"text": "Here is something I just came across:\n\nLog4j version 2.15.0 has been released to address this flaw, but The Record reports that its fix merely changes a setting from \"false\" to \"true\" by default. Users who change the setting back to \"false\" remain vulnerable to attack. Luckily this means that servers running earlier versions of Log4j can mitigate the attack by changing that setting.\n\nASF says that \"this behavior can be mitigated by setting system property 'log4j2.formatMsgNoLookups' to 'true' or by removing the JndiLookup class from the classpath (example: zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class)\" in earlier versions of Log4j if users can't upgrade to the 2.15.0 release."

HTML:

<div class="css_messagetext">Here is something I just came across:

Log4j version 2.15.0 has been released to address this flaw, but The Record reports that its fix merely changes a setting from "false" to "true" by default. Users who change the setting back to "false" remain vulnerable to attack. Luckily this means that servers running earlier versions of Log4j can mitigate the attack by changing that setting.

ASF says that "this behavior can be mitigated by setting system property 'log4j2.formatMsgNoLookups' to 'true' or by removing the JndiLookup class from the classpath (example: zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class)" in earlier versions of Log4j if users can't upgrade to the 2.15.0 release.</div>

Rendered HTML:

image
ojchase commented 2 years ago

This is inconsistent. I have other cases that look fine.

DJF3 commented 2 years ago

It almost looks like the HTML interpretation ignores \n\n. Let me know if you see this happening again. (and thanks for providing the exact information that is needed with your questions!)

ojchase commented 2 years ago

Oh it definitely keeps happening. I downloaded several archives yesterday and saw this several times. It's also not necessarily \n\n. I see it with single \n as well. It's just not consistent, but I haven't noticed a pattern yet.

(Thanks; I try. I'm a developer myself and know the pain of a vague bug!)

DJF3 commented 2 years ago

@ojchase I found that "\n" in a message that has the TEXT field but no HTML field is not interpreted. Fixed. Replace: data_text = convertURL(str(msg['text'])) with data_text = convertURL(str(msg['text']).replace("\n","<br>")) The fix will be in the next (soon to be released) version. Again, thanks for sharing!

DJF3 commented 2 years ago

@ojchase
A major update with many fixes, including the fix for this problem has just been posted here Can you let me know if it is fixed?