adifyr / obsidian-chat-view

An elegant chat view for Obsidian pages.
MIT License
202 stars 11 forks source link

How to render a multi-line chat message with internal formatting? #34

Open rshmhrj opened 8 months ago

rshmhrj commented 8 months ago

Similar to #30 I'm also copy/pasting messages from Teams (since export is disabled)

Some of the messages contain multiple lines and other internal formatting (like replies, quoting other chat messages).

Here is an example sanitized from teams:

[Monday 9:09 PM] Rishi Maharaj
The `ThreadLocal` works, but it is dumb... like super super dumb

Been banging my head on this issue for the past 5 hours.

Solved it, but it's a dumb dumb solution and I hate it
[Monday 9:10 PM] First Last
We discussed this yesterday. 

A root abstract class would be very useful.

[Monday 9:12 PM] Rishi Maharaj
> `com.example.data.model` will contain common database representations -- classes in here will most likely be annotated with `@Document`

Aren't these package exclusive to database models since all the classes will be denoted with @Document?

Pasting directly into a chat-transcript code block renders this: image

Adding colons after the names, and some formatting for color:

\```chat-transcript
> Rishi Maharaj
[Rishi Maharaj=blue, First Last=green]
{header=h4, mw=80}
[Monday 9:09 PM] Rishi Maharaj:
The `ThreadLocal` works, but it is dumb... like super super dumb

Been banging my head on this issue for the past 5 hours.

Solved it, but it's a dumb dumb solution and I hate it
[Monday 9:10 PM] First Last:
We discussed this yesterday. 

A root abstract class would be very useful.

[Monday 9:12 PM] Rishi Maharaj:
> `com.example.data.model` will contain common database representations -- classes in here will most likely be annotated with `@Document`

Aren't these package exclusive to database models since all the classes will be denoted with @Document?
\```

Results in this: image

Replacing line breaks with \n doesn't do much either:

\```chat-transcript
> Rishi Maharaj
[Rishi Maharaj=blue, First Last=green]
{header=h4, mw=80}
[Monday 9:09 PM] Rishi Maharaj: The `ThreadLocal` works, but it is dumb... like super super dumb\n\nBeen banging my head on this issue for the past 5 hours.\n\nSolved it, but it's a dumb dumb solution and I hate it
[Monday 9:10 PM] First Last: We discussed this yesterday.\n\nA root abstract class would be very useful.\n\n
[Monday 9:12 PM] Rishi Maharaj: > `com.example.data.model` will contain common database representations -- classes in here will most likely be annotated with `@Document`\n\nAren't these package exclusive to database models since all the classes will be denoted with @Document?
\```

image

Any ideas, suggestions or workarounds?

adifyr commented 8 months ago

Hi. Thanks for writing in. I'm adding MS Teams support for Chat View in the upcoming release.

Brazier85 commented 7 months ago

Hi, I have the same "problem" with the exported data from this tool here: https://github.com/carderne/signal-export

Would be really nice to get multiline support!

trych commented 17 hours ago

I would also really appreaciate multi line support.