mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Signed-off-by: PJ Eby <pje@telecommunity.com>
This commit is contained in:
		
							
								
								
									
										8
									
								
								vendor/github.com/russross/blackfriday/latex.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								vendor/github.com/russross/blackfriday/latex.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -17,6 +17,7 @@ package blackfriday | ||||
|  | ||||
| import ( | ||||
| 	"bytes" | ||||
| 	"strings" | ||||
| ) | ||||
|  | ||||
| // Latex is a type that implements the Renderer interface for LaTeX output. | ||||
| @@ -39,16 +40,17 @@ func (options *Latex) GetFlags() int { | ||||
| } | ||||
|  | ||||
| // render code chunks using verbatim, or listings if we have a language | ||||
| func (options *Latex) BlockCode(out *bytes.Buffer, text []byte, lang string) { | ||||
| 	if lang == "" { | ||||
| func (options *Latex) BlockCode(out *bytes.Buffer, text []byte, info string) { | ||||
| 	if info == "" { | ||||
| 		out.WriteString("\n\\begin{verbatim}\n") | ||||
| 	} else { | ||||
| 		lang := strings.Fields(info)[0] | ||||
| 		out.WriteString("\n\\begin{lstlisting}[language=") | ||||
| 		out.WriteString(lang) | ||||
| 		out.WriteString("]\n") | ||||
| 	} | ||||
| 	out.Write(text) | ||||
| 	if lang == "" { | ||||
| 	if info == "" { | ||||
| 		out.WriteString("\n\\end{verbatim}\n") | ||||
| 	} else { | ||||
| 		out.WriteString("\n\\end{lstlisting}\n") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user