tldr-pages / tldr

📚 Collaborative cheatsheets for console commands
https://tldr.sh
Other
50.42k stars 4.12k forks source link

Curly braces not properly escaped on pages (e.g. docker, playerctl, fakedata) #10125

Closed mrnossiom closed 10 months ago

mrnossiom commented 1 year ago

👋🏻 Hi

Problem

On some pages, we actually need to show parenthesis {{ ... }} like the ones of docker inspect and playerctl for templating.

Docker example image where it should be in fact https://github.com/tldr-pages/tldr/blob/e9995a8249a19c3bfb2e20a0f91c52b177578cc4/pages/common/docker-inspect.md?plain=1#L16

Research

I tried to find a way to escape these, but after some research, I only found someone that tried to escape for fakedata https://github.com/tldr-pages/tldr/blob/e9995a8249a19c3bfb2e20a0f91c52b177578cc4/pages/common/fakedata.md?plain=1#L24 but it does not actually work image

I asked on the Matrix chat, but one told me to open an issue here...

Solution

I'll create a PR as soon as I know how to escape the parentheses to fix most of the pages. I think I can find more example of this issue.

PS: I use tldr every day, and it is a great piece of information. Thanks

mrnossiom commented 1 year ago

Wait, I actually forgot I already opened an issue for this : #10040

principis commented 1 year ago

I think backslash for escaping would be easy to implement in clients.

mrnossiom commented 10 months ago

@kbdharun Does that mean that the cases mentioned here were fixed in the process ?

kbdharun commented 10 months ago

@kbdharun Does that mean that the cases mentioned here were fixed in the process ?

Yes, Once a new client specification release is made. Clients will be able to update their code and fix escaping (by referring to the examples, in client spec).

mrnossiom commented 10 months ago

Yeah, I know, but does the docker tldr page has been fixed ? I don't remember which other one, but I know there was another case that didn't match the spec as it is now.

kbdharun commented 9 months ago

Yeah, I know, but does the docker tldr page has been fixed ? I don't remember which other one, but I know there was another case that didn't match the spec as it is now.

The docker tldr page indeed hasn't been fixed yet (I will open a PR to update it now), I believe the other case would be playerctl which we updated recently at #11616. Feel free to let us know if any other page needs to be fixed. Btw, tlrc has implemented the change in the recent release and it is live to use.

An escaped page now will look something like this:

image

mrnossiom commented 9 months ago

Great news! Thanks

I didn't encounter any other glitched page during my investigation.