mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Rewrite markdown rendering to blackfriday v2 and rewrite orgmode rendering to go-org (#8560)
* Rewrite markdown rendering to blackfriday v2.0 * Fix style * Fix go mod with golang 1.13 * Fix blackfriday v2 import * Inital orgmode renderer migration to go-org * Vendor go-org dependency * Ignore errors :/ * Update go-org to latest version * Update test * Fix go-org test * Remove unneeded code * Fix comments * Fix markdown test * Fix blackfriday regression rendering HTML block
This commit is contained in:
		
							
								
								
									
										19
									
								
								vendor/github.com/niklasfasching/go-org/org/util.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								vendor/github.com/niklasfasching/go-org/org/util.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
package org
 | 
			
		||||
 | 
			
		||||
func isSecondBlankLine(d *Document, i int) bool {
 | 
			
		||||
	if i-1 <= 0 {
 | 
			
		||||
		return false
 | 
			
		||||
	}
 | 
			
		||||
	t1, t2 := d.tokens[i-1], d.tokens[i]
 | 
			
		||||
	if t1.kind == "text" && t2.kind == "text" && t1.content == "" && t2.content == "" {
 | 
			
		||||
		return true
 | 
			
		||||
	}
 | 
			
		||||
	return false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func isImageOrVideoLink(n Node) bool {
 | 
			
		||||
	if l, ok := n.(RegularLink); ok && l.Kind() == "video" || l.Kind() == "image" {
 | 
			
		||||
		return true
 | 
			
		||||
	}
 | 
			
		||||
	return false
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user