forked from forgejo/forgejo
Signed-off-by: PJ Eby <pje@telecommunity.com>
This commit is contained in:
parent
76106ab080
commit
fc36567ee1
9 changed files with 292 additions and 110 deletions
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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue