loot / libloot

A C++ library for accessing LOOT's metadata and sorting functionality.
GNU General Public License v3.0
32 stars 11 forks source link

File::GetDisplayName() falls back to file name #71

Closed TanninOne closed 4 years ago

TanninOne commented 4 years ago

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.

Ortham commented 4 years ago

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.

Ortham commented 4 years ago

Fixed in 36d90ee72b699c2847c00f166e5a69e8c1df9c2a.