Skip to content

Commit 4bc0a19

Browse files
author
openset
committed
Update: CmdPost
1 parent f0db80f commit 4bc0a19

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/post/post.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@ func runPost(cmd *base.Command, args []string) {
5454
question.TitleSlug,
5555
))
5656
buf.WriteString(fmt.Sprintf("\n## %s. %s%s\n\n", question.QuestionFrontendId, question.TranslatedTitle, question.Difficulty.Str()))
57+
buf.WriteString("{% raw %}\n\n")
5758
content := strings.ReplaceAll(question.TranslatedContent, "\r", "")
5859
// remove style
5960
reg := regexp.MustCompile(`<style[\S\s]+?</style>`)
6061
content = reg.ReplaceAllString(content, "")
6162
content = strings.ReplaceAll(content, "\n\n\t", "\n\t")
6263
content = strings.TrimSpace(content)
63-
buf.WriteString(content + "\n")
64+
buf.WriteString(content)
65+
buf.WriteString("\n\n{% endraw %}\n")
6466
if len(question.TopicTags) > 0 {
6567
buf.WriteString("\n### 相关话题\n")
6668
}

0 commit comments

Comments
 (0)