Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
maximbaz opened this issue Jul 1, 2023 · 4 comments
Open

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

maximbaz opened this issue Jul 1, 2023 · 4 comments
Labels

Comments

@maximbaz
Copy link
Contributor

maximbaz commented Jul 1, 2023

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.

  • If someone sends bold message to me from Android app, I want to see it in scli rendered as bold.
  • If I reply with *hello* from scli, I want it rendered as bold on Android.
  • The same logic for _italic_, ~strikethrough and `monospace`.
    • Bonus points for supporting multiline monospace formatting using
```
echo hello
echo world
```

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

@exquo
Copy link
Collaborator

exquo commented Jul 6, 2023

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: AsamK/signal-cli#1271.

@maximbaz
Copy link
Contributor Author

maximbaz commented Jul 6, 2023

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
Copy link
Collaborator

exquo commented Jul 6, 2023

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
Copy link
Contributor Author

maximbaz commented Jul 6, 2023

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 AsamK/signal-cli#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 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants