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

fix(tag parser): use %% to get a literal percent sign (%) #2748

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xi
Copy link

@xi xi commented Jun 19, 2022

As described in the lemonbar docs: https://github.com/LemonBoy/bar#formatting

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other: Replace this with a description of the type of this PR

Description

The lemonbar documentation says that you can

Use %% to get a literal percent sign (%).

That was not implemented in polybar.

Related Issues & Documents

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

@patrick96
Copy link
Member

This is going to break a lot of things. Take for example this config:

[bar/example]
modules-left = text

[module/text]
type = custom/text
format = Text%

For this, polybar will produce the string %{l}Text%%{PR} which is then rendered as Text%{PR}, even though we would expect it to render as Text%.

The literal percentage sign in format unintentionally escapes formatting tags that follow the text module.

I'm not sure adding literal percentage signs like this is possible at all in a backwards-compatible way.

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 this pull request may close these issues.

None yet

2 participants