Fix File::GetDisplayName() not escaping special chars

When display_ is an empty string, GetDisplayName() returns name_, but
name_'s value might contain Markdown special characters, and
GetDisplayName() is supposed to return a Markdown string, though this
was poorly documented.
This commit is contained in:
Oliver Hamlet
2020-07-27 22:18:54 +01:00
parent b4dc6e2f3a
commit 36d90ee72b
6 changed files with 67 additions and 16 deletions
+8 -2
View File
@@ -47,7 +47,8 @@ public:
* @param name
* The filename of the file.
* @param display
* The name to be displayed for the file in messages.
* The name to be displayed for the file in messages, formatted using
* GitHub Flavored Markdown.
* @param condition
* The File's condition string.
* @return A File object.
@@ -77,7 +78,12 @@ public:
/**
* Get the display name of the file.
* @return The file's display name.
*
* If the File was constructed with an empty display string, the name field
* will be returned instead, with any `ASCII punctuation characters
* <https://github.github.com/gfm/#ascii-punctuation-character>`_ escaped.
* Escaping is not performed if returning the value of the display string.
* @return The file's display name or filename.
*/
LOOT_API std::string GetDisplayName() const;