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

Rendering a single pair of curly braces outside of a placeholder is impossible #12445

Closed
acuteenvy opened this issue Mar 2, 2024 · 0 comments · Fixed by #12446
Closed

Rendering a single pair of curly braces outside of a placeholder is impossible #12445

acuteenvy opened this issue Mar 2, 2024 · 0 comments · Fixed by #12446
Labels
clients Issues pertaining to a particular client or the clients as whole.

Comments

@acuteenvy
Copy link
Member

#12158 made it so that {{{x}}}} always means one set of braces is inside the placeholder. As it turns out, that's not always the case. Here's an example from the page for select:

- Create a menu from a Bash array:

`{{fruits}}=({{apple}} {{orange}} {{pear}} {{banana}}); select {{word}} in ${{{fruits}}[@]}; do echo ${{word}}; done`

By the current specification, ${{{fruits}}[@]} will be rendered as ${fruits[@]}, not ${fruits}[@]. That looks kind of weird in my opinion, because one brace is highlighted, and the other one is not.

An alternative is ${{{fruits[@]}}}, which would be rendered as ${fruits[@]} - that's better, but still not what we need.


I don't think there's a way to clearly express which braces mark the placeholder without introducing a way to escape a single brace, which we've decided not to do because then, we'd also have to escape backslashes with backslashes in Windows paths. That being said, without proper escaping, there will be no way of supporting every single way of rendering curly braces near placeholders.

So, one "solution" that at least won't require a tremendous amount of changes, is to leave the spec as it is now and every time we have a page that requires curly braces outside of a placeholder, put them inside instead. That means {{{x}}} will always be rendered as {x}, and there is no way to express that we want {x}, {x} or {x}. select is the only page affected so far (or at least the only one that I know of), so it's not an extremely important problem. This requires no modifications to the current client spec, so we can proceed with the release if we decide to use it. I just want to discuss how are we going to handle these special cases from now on.

screenshot

@acuteenvy acuteenvy added the clients Issues pertaining to a particular client or the clients as whole. label Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clients Issues pertaining to a particular client or the clients as whole.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant