loot/libloot

File::GetDisplayName() falls back to file name

TanninOne opened this issue · 2 comments

Thi is super nitpicky and tbh I don't really have a solution here that doesn't break backwards compatibility but maybe you do, so here goes:

Calling File::GetDisplayName() on a file that has no "display:" specified in the master-/userlist returns just the file name.
The display field is usually used for markdown code however but if the file name gets returned, symbols that are special symbols in markdown are not escaped though. So if the filename is foo _bar_ name.esp it might end up rendered as foo bar name.esp without the underscores but bar in italics.

Just to be clear: I'm perfectly ok with this being closed as "won't fix", just came across and thought I'd mention it.

I don't think I'd thought about markdown special characters... LOOT has a EscapeMarkdownSpecialChars() function, but it's only used for escaping strings in cyclic interaction error messages, so I'm being pretty inconsistent.

Although it's a breaking change, I think I'm happy to class this as a bug, as the intention is that GetDisplayName() should provide something that can be handled as Markdown.

Fixed in 36d90ee.