Support blank lines before content in footnote definitions.
This commit is contained in:
		
							parent
							
								
									5d20d3e99b
								
							
						
					
					
						commit
						6a1bdd5fee
					
				| @ -6,4 +6,3 @@ | ||||
| baz | ||||
| #+END_EXAMPLE | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -4,8 +4,10 @@ use nom::bytes::complete::tag_no_case; | ||||
| use nom::bytes::complete::take_while; | ||||
| use nom::character::complete::digit1; | ||||
| use nom::character::complete::space0; | ||||
| use nom::combinator::opt; | ||||
| use nom::combinator::recognize; | ||||
| use nom::combinator::verify; | ||||
| use nom::multi::many0; | ||||
| use nom::multi::many1; | ||||
| use nom::multi::many_till; | ||||
| use nom::sequence::tuple; | ||||
| @ -41,8 +43,15 @@ pub fn footnote_definition<'b, 'g, 'r, 's>( | ||||
|     } | ||||
|     start_of_line(input)?; | ||||
|     // Cannot be indented.
 | ||||
|     let (remaining, (_lead_in, lbl, _lead_out, _ws)) = | ||||
|         tuple((tag_no_case("[fn:"), label, tag("]"), space0))(input)?; | ||||
|     let (remaining, (_, lbl, _, _, _)) = tuple(( | ||||
|         tag_no_case("[fn:"), | ||||
|         label, | ||||
|         tag("]"), | ||||
|         space0, | ||||
|         opt(verify(many0(blank_line), |lines: &Vec<OrgSource<'_>>| { | ||||
|             lines.len() <= 2 | ||||
|         })), | ||||
|     ))(input)?; | ||||
|     let contexts = [ | ||||
|         ContextElement::ConsumeTrailingWhitespace(true), | ||||
|         ContextElement::Context("footnote definition"), | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander