isamert / scli

a simple terminal user interface for signal messenger (using signal-cli)
GNU General Public License v3.0
432 stars 40 forks source link

Synchronize scli's `use-formatting` with the one used by Signal #218

Open maximbaz opened 1 year ago

maximbaz commented 1 year ago

Now that Signal has implemented support for bold, italic, strikethrough and monospace formatting, it would be nice to synchronize that with scli's own formatting logic, when use-formatting is set to true.

I'm not sure how the logic should be when use-formatting is set to false.

exquo commented 1 year ago

Yes! Displaying formatting in the received messages should become the default, since it's the official Signal behavior now. The --use-formatting option, that had been used for just that, should be deprecated; perhaps to be replaced by its opposite - to optionally disable the formatting.

However, sending indicating formatting in messages is not yet supported by signal-cli in DBus mode: https://github.com/AsamK/signal-cli/issues/1271.

maximbaz commented 1 year ago

To give some relevant feedback, I actually used to disable formatting for one reason only - I send code snippets very often, and I just hate that they look corrupted, potentially even affecting the formatting of the non-code part of the message. Long-term it would be nice to send the code wrapped in a pair of backticks formatted with monospace, but maybe we could in the meantime just skip any formatting in such blocks? Or would it be very hard?

exquo commented 1 year ago

If I understand correctly, the formatting looks corrupted when the symbols *, _ or ~ appear inside the code block (i.e. inside the backticks `..`).

Scli's --use-formatting so far did not apply any special formatting for the "monospace" text. In a terminal-based program like scli, that can usually be assumed to be in monospace anyway, it's not clear what effect that should have. But it should indeed at least not apply other formatting to the text inside the code block. Thanks for the feedback on this! To be fixed.

maximbaz commented 1 year ago

You got it correctly - we don't need to format anything inside backticks specially on scli's side, terminal app is indeed already monospace, I'd like the text inside backticks that I send from scli to be rendered in monospace in official Signal apps, once https://github.com/AsamK/signal-cli/issues/1271 is implemented 😊

And to confirm one more thing, content wrapped in a pair of single backticks and a pair of triplets of backticks should both be considered code blocks 😊