mirror of
https://github.com/go-gitea/gitea.git
synced 2025-06-29 04:29:55 +00:00
Fix markdown render behaviors (#34122)
* Fix #27645 * Add config options `MATH_CODE_BLOCK_DETECTION`, problematic syntaxes are disabled by default * Fix #33639 * Add config options `RENDER_OPTIONS_*`, old behaviors are kept
This commit is contained in:
parent
ee6929d96b
commit
e1c2d05bde
33 changed files with 418 additions and 222 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -46,7 +47,7 @@ type RenderOptions struct {
|
|||
// user&repo, format&style®exp (for external issue pattern), teams&org (for mention)
|
||||
// RefTypeNameSubURL (for iframe&asciicast)
|
||||
// markupAllowShortIssuePattern
|
||||
// markdownLineBreakStyle (comment, document)
|
||||
// markdownNewLineHardBreak
|
||||
Metas map[string]string
|
||||
|
||||
// used by external render. the router "/org/repo/render/..." will output the rendered content in a standalone page
|
||||
|
@ -247,7 +248,8 @@ func Init(renderHelpFuncs *RenderHelperFuncs) {
|
|||
}
|
||||
|
||||
func ComposeSimpleDocumentMetas() map[string]string {
|
||||
return map[string]string{"markdownLineBreakStyle": "document"}
|
||||
// TODO: there is no separate config option for "simple document" rendering, so temporarily use the same config as "repo file"
|
||||
return map[string]string{"markdownNewLineHardBreak": strconv.FormatBool(setting.Markdown.RenderOptionsRepoFile.NewLineHardBreak)}
|
||||
}
|
||||
|
||||
type TestRenderHelper struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue