mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	* fix wrong init dependency on markup extensions
This commit is contained in:
		
				
					committed by
					
						
						techknowlogick
					
				
			
			
				
	
			
			
			
						parent
						
							d07edc5336
						
					
				
				
					commit
					31ad8b7026
				
			@@ -15,7 +15,6 @@ import (
 | 
				
			|||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/gitea/modules/log"
 | 
						"code.gitea.io/gitea/modules/log"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/markup/external"
 | 
					 | 
				
			||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
	"code.gitea.io/gitea/routers"
 | 
						"code.gitea.io/gitea/routers"
 | 
				
			||||||
	"code.gitea.io/gitea/routers/routes"
 | 
						"code.gitea.io/gitea/routers/routes"
 | 
				
			||||||
@@ -120,8 +119,6 @@ func runWeb(ctx *cli.Context) error {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	routers.GlobalInit()
 | 
						routers.GlobalInit()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	external.RegisterParsers()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	m := routes.NewMacaron()
 | 
						m := routes.NewMacaron()
 | 
				
			||||||
	routes.RegisterRoutes(m)
 | 
						routes.RegisterRoutes(m)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,6 +20,7 @@ import (
 | 
				
			|||||||
	"strconv"
 | 
						"strconv"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/markup"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/markup/external"
 | 
						"code.gitea.io/gitea/modules/markup/external"
 | 
				
			||||||
	"code.gitea.io/gitea/routers"
 | 
						"code.gitea.io/gitea/routers"
 | 
				
			||||||
	"code.gitea.io/gitea/routers/routes"
 | 
						"code.gitea.io/gitea/routers/routes"
 | 
				
			||||||
@@ -113,6 +114,7 @@ func runPR() {
 | 
				
			|||||||
	log.Printf("[PR] Setting up router\n")
 | 
						log.Printf("[PR] Setting up router\n")
 | 
				
			||||||
	//routers.GlobalInit()
 | 
						//routers.GlobalInit()
 | 
				
			||||||
	external.RegisterParsers()
 | 
						external.RegisterParsers()
 | 
				
			||||||
 | 
						markup.Init()
 | 
				
			||||||
	m := routes.NewMacaron()
 | 
						m := routes.NewMacaron()
 | 
				
			||||||
	routes.RegisterRoutes(m)
 | 
						routes.RegisterRoutes(m)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,6 +15,14 @@ import (
 | 
				
			|||||||
func Init() {
 | 
					func Init() {
 | 
				
			||||||
	getIssueFullPattern()
 | 
						getIssueFullPattern()
 | 
				
			||||||
	NewSanitizer()
 | 
						NewSanitizer()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// since setting maybe changed extensions, this will reload all parser extensions mapping
 | 
				
			||||||
 | 
						extParsers = make(map[string]Parser)
 | 
				
			||||||
 | 
						for _, parser := range parsers {
 | 
				
			||||||
 | 
							for _, ext := range parser.Extensions() {
 | 
				
			||||||
 | 
								extParsers[strings.ToLower(ext)] = parser
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Parser defines an interface for parsering markup file to HTML
 | 
					// Parser defines an interface for parsering markup file to HTML
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,6 +19,7 @@ import (
 | 
				
			|||||||
	"code.gitea.io/gitea/modules/log"
 | 
						"code.gitea.io/gitea/modules/log"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/mailer"
 | 
						"code.gitea.io/gitea/modules/mailer"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/markup"
 | 
						"code.gitea.io/gitea/modules/markup"
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/markup/external"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/ssh"
 | 
						"code.gitea.io/gitea/modules/ssh"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -75,6 +76,7 @@ func GlobalInit() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if setting.InstallLock {
 | 
						if setting.InstallLock {
 | 
				
			||||||
		highlight.NewContext()
 | 
							highlight.NewContext()
 | 
				
			||||||
 | 
							external.RegisterParsers()
 | 
				
			||||||
		markup.Init()
 | 
							markup.Init()
 | 
				
			||||||
		if err := initDBEngine(); err == nil {
 | 
							if err := initDBEngine(); err == nil {
 | 
				
			||||||
			log.Info("ORM engine initialization successful!")
 | 
								log.Info("ORM engine initialization successful!")
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user