From 4bc0a19bb89d15c63a53cde718f27c7f693dc6ec Mon Sep 17 00:00:00 2001 From: openset Date: Thu, 18 Jul 2019 12:31:19 +0800 Subject: [PATCH] Update: CmdPost --- internal/post/post.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/post/post.go b/internal/post/post.go index 68860633f..b8a252b1c 100644 --- a/internal/post/post.go +++ b/internal/post/post.go @@ -54,13 +54,15 @@ func runPost(cmd *base.Command, args []string) { question.TitleSlug, )) buf.WriteString(fmt.Sprintf("\n## %s. %s%s\n\n", question.QuestionFrontendId, question.TranslatedTitle, question.Difficulty.Str())) + buf.WriteString("{% raw %}\n\n") content := strings.ReplaceAll(question.TranslatedContent, "\r", "") // remove style reg := regexp.MustCompile(``) content = reg.ReplaceAllString(content, "") content = strings.ReplaceAll(content, "\n\n\t", "\n\t") content = strings.TrimSpace(content) - buf.WriteString(content + "\n") + buf.WriteString(content) + buf.WriteString("\n\n{% endraw %}\n") if len(question.TopicTags) > 0 { buf.WriteString("\n### 相关话题\n") }