mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Update to go-org 1.3.2 (#12728)
* Update to go-org 1.3.2 Fix #12727 Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix unit test Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		
							
								
								
									
										6
									
								
								vendor/github.com/niklasfasching/go-org/org/headline.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								vendor/github.com/niklasfasching/go-org/org/headline.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -35,14 +35,14 @@ var tagRegexp = regexp.MustCompile(`(.*?)\s+(:[A-Za-z0-9_@#%:]+:\s*$)`) | ||||
|  | ||||
| func lexHeadline(line string) (token, bool) { | ||||
| 	if m := headlineRegexp.FindStringSubmatch(line); m != nil { | ||||
| 		return token{"headline", len(m[1]), m[2], m}, true | ||||
| 		return token{"headline", 0, m[2], m}, true | ||||
| 	} | ||||
| 	return nilToken, false | ||||
| } | ||||
|  | ||||
| func (d *Document) parseHeadline(i int, parentStop stopFn) (int, Node) { | ||||
| 	t, headline := d.tokens[i], Headline{} | ||||
| 	headline.Lvl = t.lvl | ||||
| 	headline.Lvl = len(t.matches[1]) | ||||
|  | ||||
| 	headline.Index = d.addHeadline(&headline) | ||||
|  | ||||
| @@ -69,7 +69,7 @@ func (d *Document) parseHeadline(i int, parentStop stopFn) (int, Node) { | ||||
| 	headline.Title = d.parseInline(text) | ||||
|  | ||||
| 	stop := func(d *Document, i int) bool { | ||||
| 		return parentStop(d, i) || d.tokens[i].kind == "headline" && d.tokens[i].lvl <= headline.Lvl | ||||
| 		return parentStop(d, i) || d.tokens[i].kind == "headline" && len(d.tokens[i].matches[1]) <= headline.Lvl | ||||
| 	} | ||||
| 	consumed, nodes := d.parseMany(i+1, stop) | ||||
| 	if len(nodes) > 0 { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user