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

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

Closed
mrnossiom opened this issue Apr 29, 2023 · 7 comments · Fixed by #10730
Closed

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

mrnossiom opened this issue Apr 29, 2023 · 7 comments · Fixed by #10730

Comments

@mrnossiom
Copy link

mrnossiom commented Apr 29, 2023

👋🏻 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

`docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' {{container}}`

Research

I tried to find a way to escape these, but after some research, I only found someone that tried to escape for fakedata

`echo "{{\{\{Generator\}\}}}" | fakedata`

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

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

@principis
Copy link
Contributor

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

@github-actions github-actions bot removed the Stale label Jun 20, 2023
@acuteenvy acuteenvy changed the title Parentheses not properly escaped on pages (e.g. docker, playerctl, fakedata) Curly braces not properly escaped on pages (e.g. docker, playerctl, fakedata) Sep 17, 2023
@mrnossiom
Copy link
Author

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

@kbdharun
Copy link
Member

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

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

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

Great news! Thanks

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

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

Successfully merging a pull request may close this issue.

3 participants