Skip to content

Commit 9a382f1

Browse files
authored
Merge pull request #128 from DominikPieper/fix/stackexchange-answer-template
Add missing %date% variables to answer template
2 parents 210d016 + bedf308 commit 9a382f1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/parsers/StackExchangeParser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class StackExchangeParser extends Parser {
4848

4949
const topAnswer = question.topAnswer
5050
? this.settings.stackExchangeAnswer
51+
.replace(/%date%/g, this.getFormattedDateForContent())
5152
.replace(/%answerContent%/g, question.topAnswer.content)
5253
.replace(/%authorName%/g, question.topAnswer.author.name)
5354
.replace(/%authorProfileURL%/g, question.topAnswer.author.profile)
@@ -56,6 +57,7 @@ class StackExchangeParser extends Parser {
5657
let answers = '';
5758
for (let i = 0; i < question.answers.length; i++) {
5859
const answer = this.settings.stackExchangeAnswer
60+
.replace(/%date%/g, this.getFormattedDateForContent())
5961
.replace(/%answerContent%/g, question.answers[i].content)
6062
.replace(/%authorName%/g, question.answers[i].author.name)
6163
.replace(/%authorProfileURL%/g, question.answers[i].author.profile);

0 commit comments

Comments
 (0)