mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Fix task-list checkbox styling (#10668)
* Fix task-list checkbox styling The pandoc renderer will append the class "task-list" to the ul element wrapping a li with one or more check-boxes. This allows us to select for them, removing their list-style-type property. However, goldmark and the gfm spec doesn't specify the "task-list" class name, so we can't use that to fix the issue there. Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com> * Update to goldmark v1.1.25 This version adds the missing space after a checkbox. Resolves: #9656 Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
		
							
								
								
									
										4
									
								
								vendor/github.com/yuin/goldmark/extension/tasklist.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/yuin/goldmark/extension/tasklist.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -92,9 +92,9 @@ func (r *TaskCheckBoxHTMLRenderer) renderTaskCheckBox(w util.BufWriter, source [ | ||||
| 		w.WriteString(`<input disabled="" type="checkbox"`) | ||||
| 	} | ||||
| 	if r.XHTML { | ||||
| 		w.WriteString(" />") | ||||
| 		w.WriteString(" /> ") | ||||
| 	} else { | ||||
| 		w.WriteString(">") | ||||
| 		w.WriteString("> ") | ||||
| 	} | ||||
| 	return gast.WalkContinue, nil | ||||
| } | ||||
|   | ||||
							
								
								
									
										29
									
								
								vendor/github.com/yuin/goldmark/parser/list.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										29
									
								
								vendor/github.com/yuin/goldmark/parser/list.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -166,20 +166,6 @@ func (b *listParser) Continue(node ast.Node, reader text.Reader, pc Context) Sta | ||||
| 		} | ||||
| 		return Continue | HasChildren | ||||
| 	} | ||||
| 	// Thematic Breaks take precedence over lists | ||||
| 	if isThematicBreak(line, reader.LineOffset()) { | ||||
| 		isHeading := false | ||||
| 		last := pc.LastOpenedBlock().Node | ||||
| 		if ast.IsParagraph(last) { | ||||
| 			c, ok := matchesSetextHeadingBar(line) | ||||
| 			if ok && c == '-' { | ||||
| 				isHeading = true | ||||
| 			} | ||||
| 		} | ||||
| 		if !isHeading { | ||||
| 			return Close | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	// "offset" means a width that bar indicates. | ||||
| 	//    -  aaaaaaaa | ||||
| @@ -200,6 +186,21 @@ func (b *listParser) Continue(node ast.Node, reader text.Reader, pc Context) Sta | ||||
| 				if !list.CanContinue(marker, typ == orderedList) { | ||||
| 					return Close | ||||
| 				} | ||||
| 				// Thematic Breaks take precedence over lists | ||||
| 				if isThematicBreak(line[match[3]-1:], 0) { | ||||
| 					isHeading := false | ||||
| 					last := pc.LastOpenedBlock().Node | ||||
| 					if ast.IsParagraph(last) { | ||||
| 						c, ok := matchesSetextHeadingBar(line) | ||||
| 						if ok && c == '-' { | ||||
| 							isHeading = true | ||||
| 						} | ||||
| 					} | ||||
| 					if !isHeading { | ||||
| 						return Close | ||||
| 					} | ||||
| 				} | ||||
|  | ||||
| 				return Continue | HasChildren | ||||
| 			} | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user