@@ -104,13 +104,13 @@ func (question questionType) getDescContent() []byte {
104104 buf .WriteString (authInfo ("description" ))
105105 buf .WriteString (question .getNavigation ())
106106 buf .WriteString (fmt .Sprintf ("\n ## %s. %s%s\n \n " , question .QuestionFrontendId , question .Title , question .Difficulty .Str ()))
107- content := strings . ReplaceAll (question .Content , " \r " , "" )
107+ cts := filterContents (question .Content )
108108 // remove style
109109 reg := regexp .MustCompile (`<style[\S\s]+?</style>` )
110- content = reg .ReplaceAllString (content , "" )
111- content = strings .ReplaceAll (content , "\n \n \t " , "\n \t " )
112- content = strings .TrimSpace (content )
113- buf .WriteString (content + " \n " )
110+ cts = reg .ReplaceAllString (cts , "" )
111+ cts = strings .ReplaceAll (cts , "\n \n \t " , "\n \t " )
112+ cts = strings .TrimSpace (cts ) + " \n "
113+ buf .WriteString (cts )
114114 buf .Write (question .getTopicTags ())
115115 buf .Write (question .getSimilarQuestion ())
116116 buf .Write (question .getHints ())
@@ -175,8 +175,7 @@ func (question questionType) getHints() []byte {
175175 buf .WriteString ("\n ### Hints\n " )
176176 }
177177 for i , hint := range hints {
178- hint = strings .ReplaceAll (hint , "\r " , "" )
179- buf .WriteString (fmt .Sprintf ("<details>\n <summary>Hint %d</summary>\n %s\n </details>\n " , i + 1 , hint ))
178+ buf .WriteString (fmt .Sprintf ("<details>\n <summary>Hint %d</summary>\n %s\n </details>\n " , i + 1 , filterContents (hint )))
180179 }
181180 return buf .Bytes ()
182181}
@@ -276,6 +275,12 @@ func handleCodeSQL(question questionType, code codeSnippetsType) {
276275 question .saveMysqlSchemas ()
277276}
278277
278+ func filterContents (cts string ) string {
279+ cts = strings .ReplaceAll (cts , "\r " , "" )
280+ cts = strings .ReplaceAll (cts , `src="/static` , `src="https://assets.leetcode.com/static_assets/public` )
281+ return cts
282+ }
283+
279284const testTpl = `package {{packageName}}
280285
281286import "testing"
0 commit comments