Ripcord Dev Logo Ripcord Development — View Ticket Login or Create Account
Ticket UUID: eeb7d0075eb70e9f3974ef89925aea64c48d5291
Title: Multi-line Code Syntax Inidcation / Coloring
Status: Closed Type: Feature_Request
Severity: Minor Priority: Low
Subsystem: General Resolution: Rejected
Last Modified: 2020-12-31 03:31:51
Version Found In: 0.3.8
frawst2019-01-14 23:40:13
```python
code
code
code```

Should create some indication of the language used, ultimately highlighting would be the best - but even a small shebang-esque
line at the top of the code block indicating the language would be nice!
cancel2019-01-15 18:36:10
There's no chance of adding language syntax highlighting -- this is a massive dependency that would at least double the size of Ripcord (seriously) and open up a huge surface area to exploits. The only reason Slack and Discord web clients can do it is that they reuse free JavaScript libraries that do syntax highlighting, but they're also very slow and can easily be attacked by bots (for example by crafting code blocks that are especially slow for a particular language's highlighting logic). They also rely on a JavaScript runtime for "security" in the event of parsing errors, so that memory can't be corrupted, which is not a luxury I have with C++. In the interest of keeping Ripcord lean'n'mean, this is not something I ever plan on adding.

As for displaying the language line of the code block, I do plan on adding that, see [0e42cd58a9]
xenoterracide2020-12-31 03:31:51

This is the killer feature for me, without this feature there's no chance of me using this software. to be honest, the biggest thing I wanted from ripcord is not to have a nasty memory leak, and not have to context switch between slack and discord. Also hopefully eventually it also works as an IRC client.

There are C libraries that do syntax highlighting, so "it's slow" is not an excuse. Here's a few.

https://www.gnu.org/software/src-highlite/ C++? https://github.com/GeSHi/niji this is in Rust, not certain how good it's C++ API is https://github.com/sourcegraph/syntaxhighlight Go https://github.com/alecthomas/chroma

and this is with only a little bit of research.