Add comments to metadata
Closes # 17
This commit is contained in:
		
							parent
							
								
									67d4f8a10a
								
							
						
					
					
						commit
						da7b3ad950
					
				
							
								
								
									
										3
									
								
								meta.go
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								meta.go
									
									
									
									
									
								
							@ -48,7 +48,8 @@ func ParseMeta (input string) (Meta, error) {
 | 
			
		||||
	meta := make(Meta)
 | 
			
		||||
	for _, line := range strings.Split(input, "\n") {
 | 
			
		||||
		line = strings.TrimSpace(line)
 | 
			
		||||
		if line == "" { continue }
 | 
			
		||||
		if line == ""                   { continue }
 | 
			
		||||
		if strings.HasPrefix(line, "#") { continue }
 | 
			
		||||
		key, value, ok := strings.Cut(line, ":")
 | 
			
		||||
		if !ok {
 | 
			
		||||
			return nil, ErrMetaMalformed
 | 
			
		||||
 | 
			
		||||
@ -20,6 +20,8 @@ FOO: baR
 | 
			
		||||
Shouldn't break anything: ---
 | 
			
		||||
 | 
			
		||||
this :  that
 | 
			
		||||
# a comment
 | 
			
		||||
  #also a comment
 | 
			
		||||
Sentence: ` + quickBrownFox + `
 | 
			
		||||
---
 | 
			
		||||
` + correctBody)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user