@@ -512,15 +512,15 @@ func (repo *Repository) composeCommonMetas(ctx context.Context) map[string]strin
512512 "repo" : repo .Name ,
513513 }
514514
515- unit , err := repo .GetUnit (ctx , unit .TypeExternalTracker )
515+ unitExternalTracker , err := repo .GetUnit (ctx , unit .TypeExternalTracker )
516516 if err == nil {
517- metas ["format" ] = unit .ExternalTrackerConfig ().ExternalTrackerFormat
518- switch unit .ExternalTrackerConfig ().ExternalTrackerStyle {
517+ metas ["format" ] = unitExternalTracker .ExternalTrackerConfig ().ExternalTrackerFormat
518+ switch unitExternalTracker .ExternalTrackerConfig ().ExternalTrackerStyle {
519519 case markup .IssueNameStyleAlphanumeric :
520520 metas ["style" ] = markup .IssueNameStyleAlphanumeric
521521 case markup .IssueNameStyleRegexp :
522522 metas ["style" ] = markup .IssueNameStyleRegexp
523- metas ["regexp" ] = unit .ExternalTrackerConfig ().ExternalTrackerRegexpPattern
523+ metas ["regexp" ] = unitExternalTracker .ExternalTrackerConfig ().ExternalTrackerRegexpPattern
524524 default :
525525 metas ["style" ] = markup .IssueNameStyleNumeric
526526 }
@@ -544,28 +544,29 @@ func (repo *Repository) composeCommonMetas(ctx context.Context) map[string]strin
544544 return repo .commonRenderingMetas
545545}
546546
547- // ComposeMetas composes a map of metas for properly rendering comments or comment-like contents (commit message)
548- func (repo * Repository ) ComposeMetas (ctx context.Context ) map [string ]string {
547+ // ComposeCommentMetas composes a map of metas for properly rendering comments or comment-like contents (commit message)
548+ func (repo * Repository ) ComposeCommentMetas (ctx context.Context ) map [string ]string {
549549 metas := maps .Clone (repo .composeCommonMetas (ctx ))
550- metas ["markdownLineBreakStyle " ] = "comment"
551- metas ["markupAllowShortIssuePattern" ] = "true"
550+ metas ["markdownNewLineHardBreak " ] = strconv . FormatBool ( setting . Markdown . RenderOptionsComment . NewLineHardBreak )
551+ metas ["markupAllowShortIssuePattern" ] = strconv . FormatBool ( setting . Markdown . RenderOptionsComment . ShortIssuePattern )
552552 return metas
553553}
554554
555555// ComposeWikiMetas composes a map of metas for properly rendering wikis
556556func (repo * Repository ) ComposeWikiMetas (ctx context.Context ) map [string ]string {
557557 // does wiki need the "teams" and "org" from common metas?
558558 metas := maps .Clone (repo .composeCommonMetas (ctx ))
559- metas ["markdownLineBreakStyle " ] = "document"
560- metas ["markupAllowShortIssuePattern" ] = "true"
559+ metas ["markdownNewLineHardBreak " ] = strconv . FormatBool ( setting . Markdown . RenderOptionsWiki . NewLineHardBreak )
560+ metas ["markupAllowShortIssuePattern" ] = strconv . FormatBool ( setting . Markdown . RenderOptionsWiki . ShortIssuePattern )
561561 return metas
562562}
563563
564- // ComposeDocumentMetas composes a map of metas for properly rendering documents (repo files)
565- func (repo * Repository ) ComposeDocumentMetas (ctx context.Context ) map [string ]string {
564+ // ComposeRepoFileMetas composes a map of metas for properly rendering documents (repo files)
565+ func (repo * Repository ) ComposeRepoFileMetas (ctx context.Context ) map [string ]string {
566566 // does document(file) need the "teams" and "org" from common metas?
567567 metas := maps .Clone (repo .composeCommonMetas (ctx ))
568- metas ["markdownLineBreakStyle" ] = "document"
568+ metas ["markdownNewLineHardBreak" ] = strconv .FormatBool (setting .Markdown .RenderOptionsRepoFile .NewLineHardBreak )
569+ metas ["markupAllowShortIssuePattern" ] = strconv .FormatBool (setting .Markdown .RenderOptionsRepoFile .ShortIssuePattern )
569570 return metas
570571}
571572
0 commit comments