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

Pipe | character as a key popup #883

Closed
devycarol opened this issue Jun 16, 2024 · 2 comments
Closed

Pipe | character as a key popup #883

devycarol opened this issue Jun 16, 2024 · 2 comments

Comments

@devycarol
Copy link
Contributor

The Issue
In layouts.md, we have:

For popups keys, you must not add a | (to be fixed).

I'm making this issue to report that this can be worked around using the label "\\|". I believe it has to do with the order that these escape-characters are parsed in the background.

I remember from when I forked OpenBoard to add a | popup that there was a specific warning in the comments about how the escape character backslashes are parsed twice from some point to another.

Further Notes
If this is ever fixed to the more intuitive "\|", it may break my personal setup and anyone else's who happened to discover this workaround. That's fine, I'll be able to fix it.

I've tested this in the JSON format, but not the plaintext one. I think one backslash makes the most sense at least for JSON, since it's still a special operator in the labels.

@Helium314
Copy link
Owner

I'll need to go through it properly but I think the "It's also possible to specify an icon" section is a bit outdated. (also related things should be finally improved in the app, thanks for reminding me)

If this is ever fixed to the more intuitive "\|", it may break my personal setup and anyone else's who happened to discover this workaround. That's fine, I'll be able to fix it.

In a json file "\|" is invalid, you always need to escape the \ with another \.
Internally, the simple format is treated basically the same as if it were a json file using only label (and popups that only use label). But since it's not a json, there is no need for the double escape and thus \| is the simple format equivalent to json "\\|".

@devycarol
Copy link
Contributor Author

Thanks!

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

No branches or pull requests

2 participants