mirror of https://github.com/daffainfo/nuclei.git
Replace break line characters with HTML notation when exporting to markdown (#3014)
* Fixes #2997, replace break line characters with HTML notation to avoid render the field text in a new line. * using short helper Co-authored-by: Víctor Zamanillo <victor.zamanillo@cifraeducacion.com> Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com> Co-authored-by: Mzack9999 <mzack9999@protonmail.com>dev
parent
a19385376c
commit
fd59841372
|
@ -160,8 +160,8 @@ func ToMarkdownTableString(templateInfo *model.Info) string {
|
|||
fields.Set("Authors", templateInfo.Authors.String())
|
||||
fields.Set("Tags", templateInfo.Tags.String())
|
||||
fields.Set("Severity", templateInfo.SeverityHolder.Severity.String())
|
||||
fields.Set("Description", templateInfo.Description)
|
||||
fields.Set("Remediation", templateInfo.Remediation)
|
||||
fields.Set("Description", lineBreakToHTML(templateInfo.Description))
|
||||
fields.Set("Remediation", lineBreakToHTML(templateInfo.Remediation))
|
||||
|
||||
classification := templateInfo.Classification
|
||||
if classification != nil {
|
||||
|
@ -239,3 +239,7 @@ func createMarkdownCodeBlock(title string, content string, language string) stri
|
|||
func createBoldMarkdown(value string) string {
|
||||
return "**" + value + "**"
|
||||
}
|
||||
|
||||
func lineBreakToHTML(text string) string {
|
||||
return strings.ReplaceAll(text, "\n", "<br>")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue