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

[Bug] Ampersands doubled in mod grid on Windows #3806

Closed
PolarisWasInDenial opened this issue Mar 11, 2023 · 2 comments · Fixed by #3807
Closed

[Bug] Ampersands doubled in mod grid on Windows #3806

PolarisWasInDenial opened this issue Mar 11, 2023 · 2 comments · Fixed by #3807
Labels
Bug GUI Issues affecting the interactive GUI Windows Issues specific for Windows

Comments

@PolarisWasInDenial
Copy link

Background

  • Operating System: Windows 10 Home
  • CKAN Version: 1.31.2
  • KSP Version: N/A; Metadata bug

Have you made any manual changes to your GameData folder (i.e., not via CKAN)? Yes

Problem

Describe the bug: Crew R and R mod (CrewQueueTwo) has 2 &s in its name on CKAN

Steps to reproduce: Open CKAN

  • Search "Crew R"
  • Read name field for Crew R&R mod

Expected behavior
Text matches mod name

Screenshots (if applicable)
image

CKAN error code (if applicable): N/A

@HebaruSan
Copy link
Member

A typo? No, the metadata is fine:

image

https://github.com/KSP-CKAN/CKAN-meta/blob/master/CrewQueueTwo/CrewQueueTwo-1.1.11.4.ckan#L4

What you're seeing is a discrepancy between Mono and .NET. See #3149, we double up the & characters because Mono turns them into hotkey markers otherwise:

image

@HebaruSan HebaruSan transferred this issue from KSP-CKAN/NetKAN Mar 11, 2023
@HebaruSan HebaruSan changed the title [Bug] Crew R&R Mod has typo in name field [Bug] Ampersands doubled on Windows Mar 11, 2023
@HebaruSan HebaruSan added Bug GUI Issues affecting the interactive GUI Windows Issues specific for Windows labels Mar 11, 2023
@HebaruSan HebaruSan changed the title [Bug] Ampersands doubled on Windows [Bug] Ampersands doubled in mod grid on Windows Mar 11, 2023
@HebaruSan
Copy link
Member

These calls to Replace probably need to be wrapped in if (Platform.IsMono):

CKAN/GUI/Model/ModList.cs

Lines 376 to 377 in 2d387d9

var name = new DataGridViewTextBoxCell { Value = mod.Name.Replace("&", "&&") };
var author = new DataGridViewTextBoxCell { Value = string.Join(", ", mod.Authors).Replace("&", "&&") };

var desc = new DataGridViewTextBoxCell { Value = mod.Abstract.Replace("&", "&&") };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug GUI Issues affecting the interactive GUI Windows Issues specific for Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants