fixup! block: parse captions
This commit is contained in:
		
					parent
					
						
							
								e56f6b2e67
							
						
					
				
			
			
				commit
				
					
						7b6b2c0420
					
				
			
		
					 1 changed files with 4 additions and 5 deletions
				
			
		| 
						 | 
					@ -660,19 +660,18 @@ impl BlockParser {
 | 
				
			||||||
                !((&mut c).take(fence_length).all(|c| c == fence)
 | 
					                !((&mut c).take(fence_length).all(|c| c == fence)
 | 
				
			||||||
                    && c.next().map_or(true, char::is_whitespace))
 | 
					                    && c.next().map_or(true, char::is_whitespace))
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            Block::Container(Table) if self.caption => !line.trim().is_empty(),
 | 
					            Block::Container(Table) if self.caption => !empty,
 | 
				
			||||||
            Block::Container(Table) => {
 | 
					            Block::Container(Table) => {
 | 
				
			||||||
                let line = line.trim();
 | 
					                let l = line_t.len();
 | 
				
			||||||
                let l = line.len();
 | 
					 | 
				
			||||||
                match l {
 | 
					                match l {
 | 
				
			||||||
                    0 => true,
 | 
					                    0 => true,
 | 
				
			||||||
                    1..=2 => false,
 | 
					                    1..=2 => false,
 | 
				
			||||||
                    _ => {
 | 
					                    _ => {
 | 
				
			||||||
                        if line.starts_with("^ ") {
 | 
					                        if line_t.starts_with("^ ") {
 | 
				
			||||||
                            self.caption = true;
 | 
					                            self.caption = true;
 | 
				
			||||||
                            true
 | 
					                            true
 | 
				
			||||||
                        } else {
 | 
					                        } else {
 | 
				
			||||||
                            line.as_bytes()[l - 1] == b'|' && line.as_bytes()[l - 2] != b'\\'
 | 
					                            line_t.as_bytes()[l - 1] == b'|' && line_t.as_bytes()[l - 2] != b'\\'
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue