backslide icon indicating copy to clipboard operation
backslide copied to clipboard

C++ lambda in code gets garbled in export

Open vorner opened this issue 5 years ago • 2 comments

Hello

Let's have a presentation with this slide:

# The Code

```cpp
use_lambda([&]() { return 42; });
```

(that's a syntax for lambda in C++)

If I do bs serve, everything is fine. But if I do bs export and then open the generated html, the code gets changed to this:

use_lambda([&](file:///home/vorner/pres/) { return 42; });

(and everything starting with the tripple slash turns into a gray comment, but that would be correct if such text actually was part of C++ code).

I think something is confused about that [&]() sequence, which is a bit link-like. If I put a space before the parentheses ([&] ()), everything is fine.

I'm using backslide 2.3.7, on Linux.

vorner avatar Nov 23 '19 14:11 vorner

I think it's the regex update for markdown links that got merged some times ago that may be flawed, it should not catch empty links anyway and should avoid anything in-between triple backticks. If you're willing to put a PR for the fix I'll gladly merge it, otherwise I have an almost complete rewrite of the tool in the pipe (long overdue though...) that should address all of these issues.

sinedied avatar Dec 02 '19 10:12 sinedied

Sorry, I'm afraid javascript is not my language :-(

vorner avatar Dec 02 '19 13:12 vorner