Backport #17083 Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This commit is contained in:
		
							parent
							
								
									fd35f56e87
								
							
						
					
					
						commit
						b673a24ee6
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -353,6 +353,10 @@ func renderDirectory(ctx *context.Context, treeLink string) { | ||||||
| 					} | 					} | ||||||
| 				} else { | 				} else { | ||||||
| 					ctx.Data["IsRenderedHTML"] = true | 					ctx.Data["IsRenderedHTML"] = true | ||||||
|  | 					buf, err = ioutil.ReadAll(rd) | ||||||
|  | 					if err != nil { | ||||||
|  | 						log.Error("ReadAll failed: %v", err) | ||||||
|  | 					} | ||||||
| 					ctx.Data["FileContent"] = strings.ReplaceAll( | 					ctx.Data["FileContent"] = strings.ReplaceAll( | ||||||
| 						gotemplate.HTMLEscapeString(string(buf)), "\n", `<br>`, | 						gotemplate.HTMLEscapeString(string(buf)), "\n", `<br>`, | ||||||
| 					) | 					) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue