@@ -104,13 +104,13 @@ func (question questionType) getDescContent() []byte {
104
104
buf .WriteString (authInfo ("description" ))
105
105
buf .WriteString (question .getNavigation ())
106
106
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 )
108
108
// remove style
109
109
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 )
114
114
buf .Write (question .getTopicTags ())
115
115
buf .Write (question .getSimilarQuestion ())
116
116
buf .Write (question .getHints ())
@@ -175,8 +175,7 @@ func (question questionType) getHints() []byte {
175
175
buf .WriteString ("\n ### Hints\n " )
176
176
}
177
177
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 )))
180
179
}
181
180
return buf .Bytes ()
182
181
}
@@ -276,6 +275,12 @@ func handleCodeSQL(question questionType, code codeSnippetsType) {
276
275
question .saveMysqlSchemas ()
277
276
}
278
277
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
+
279
284
const testTpl = `package {{packageName}}
280
285
281
286
import "testing"
0 commit comments