Skip to content

Commit 142f07e

Browse files
committed
fine tune comments
1 parent 63e68b1 commit 142f07e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/markup/render.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ const (
3737
)
3838

3939
var RenderBehaviorForTesting struct {
40-
// Markdown line break rendering has 2 behaviors: keep soft ("\n" for comments) or use hard (replace "\n" with "<br>" for non-comments)
40+
// Markdown line break rendering has 2 default behaviors:
41+
// * Use hard: replace "\n" with "<br>" for comments, setting.Markdown.EnableHardLineBreakInComments=true
42+
// * Keep soft: "\n" for non-comments (a.k.a. documents), setting.Markdown.EnableHardLineBreakInDocuments=false
4143
// In history, there was a mess:
4244
// * The behavior was controlled by `Metas["mode"] != "document",
4345
// * However, many places render the content without setting "mode" in Metas, all these places used comment line break setting incorrectly
@@ -117,7 +119,7 @@ func Render(ctx *RenderContext, input io.Reader, output io.Writer) error {
117119
if ctx.RelativePath != "" {
118120
if externalRender, ok := renderer.(ExternalRenderer); ok && externalRender.DisplayInIFrame() {
119121
if !ctx.InStandalonePage {
120-
// for an external render, it could only output its content in a standalone page
122+
// for an external "DisplayInIFrame" render, it could only output its content in a standalone page
121123
// otherwise, a <iframe> should be outputted to embed the external rendered page
122124
return renderIFrame(ctx, output)
123125
}

0 commit comments

Comments
 (0)