Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Lang/Cpp/CppDocGen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,20 @@ export class CppDocGen implements IDocGen {
}

protected generateAuthorTag(lines: string[]) {
let dateFormat: string = "YYYY-MM-DD"; // Default to ISO standard if not defined
if ( this.cfg.Generic.dateFormat.trim().length !== 0) {
dateFormat = this.cfg.Generic.dateFormat; // Overwrite with user format
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dateFormat = this.cfg.Generic.dateFormat; // Overwrite with user format
dateFormat = this.cfg.Generic.dateFormat.trim(); // Overwrite with user format

}
if (this.cfg.Generic.authorTag.trim().length !== 0) {
const authorInfo = this.getAuthorInfo();
// Allow substitution of {author} and {email} only
// Allow substitution of {author}, {email}, and {date} only
lines.push(
...templates.getMultiTemplatedString(
this.cfg.Generic.authorTag,
[
{ toReplace: this.cfg.authorTemplateReplace, with: authorInfo.authorName },
{ toReplace: this.cfg.emailTemplateReplace, with: authorInfo.authorEmail },
{ toReplace: this.cfg.dateTemplateReplace, with: moment().format(dateFormat) },
],
).split("\n"),
);
Expand Down