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

Missing whitespace highlight in multi-line strings #6045

Closed
Nick-Hall opened this issue May 19, 2021 · 1 comment
Closed

Missing whitespace highlight in multi-line strings #6045

Nick-Hall opened this issue May 19, 2021 · 1 comment
Assignees
Labels
bug Something is broken.
Milestone

Comments

@Nick-Hall
Copy link

Describe the issue

A single space before or after a newline in a multi-line string is not highlighted.

To Reproduce the issue

Create the source string "Hello\n world." and view it in the editor.

Expected behavior

I expect to see "Hello" on the first line and " world." on the second line with the leading space highlighted.

Server configuration and status

Hosted Weblate - Gramps project (trial)

The actual string is here. The space before "Available" in the English source string is not highlighted and will probably be missed by translators.

Suggested Fix

On line 68 in the trans/templatetags/translations.py file, specify the re.MULTILINE regular expression flag.

e.g. WHITESPACE_RE = re.compile(r"( +| $|^ )", re.M)

Sorry, I haven't set up a development environment to test this yet.

@nijel nijel self-assigned this May 20, 2021
@nijel nijel added the bug Something is broken. label May 20, 2021
@nijel nijel added this to the 4.7 milestone May 20, 2021
@nijel nijel closed this as completed in 3347831 May 20, 2021
@github-actions
Copy link

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

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

No branches or pull requests

2 participants