fixup! inline: disallow whitespace after/before emph
This commit is contained in:
		
					parent
					
						
							
								d050c504ae
							
						
					
				
			
			
				commit
				
					
						0605a0d901
					
				
			
		
					 1 changed files with 4 additions and 5 deletions
				
			
		| 
						 | 
					@ -116,7 +116,7 @@ impl<I: Iterator<Item = char> + Clone> Parser<I> {
 | 
				
			||||||
                .or_else(|| self.parse_container(&first))
 | 
					                .or_else(|| self.parse_container(&first))
 | 
				
			||||||
                .or_else(|| self.parse_atom(&first))
 | 
					                .or_else(|| self.parse_atom(&first))
 | 
				
			||||||
                .unwrap_or(Event {
 | 
					                .unwrap_or(Event {
 | 
				
			||||||
                    kind: if first.kind == lex::Kind::Whitespace {
 | 
					                    kind: if matches!(first.kind, lex::Kind::Whitespace) {
 | 
				
			||||||
                        EventKind::Whitespace
 | 
					                        EventKind::Whitespace
 | 
				
			||||||
                    } else {
 | 
					                    } else {
 | 
				
			||||||
                        EventKind::Str
 | 
					                        EventKind::Str
 | 
				
			||||||
| 
						 | 
					@ -402,10 +402,9 @@ impl<I: Iterator<Item = char> + Clone> Parser<I> {
 | 
				
			||||||
                        return None;
 | 
					                        return None;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    if matches!(dir, Dir::Both)
 | 
					                    if matches!(dir, Dir::Both)
 | 
				
			||||||
                        && self
 | 
					                        && self.events.back().map_or(false, |ev| {
 | 
				
			||||||
                            .events
 | 
					                            matches!(ev.kind, EventKind::Whitespace | EventKind::Atom(Softbreak))
 | 
				
			||||||
                            .back()
 | 
					                        })
 | 
				
			||||||
                            .map_or(false, |ev| matches!(ev.kind, EventKind::Whitespace))
 | 
					 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        return None;
 | 
					                        return None;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue