wip
This commit is contained in:
		
					parent
					
						
							
								60927e7298
							
						
					
				
			
			
				commit
				
					
						5afc6a41a8
					
				
			
		
					 1 changed files with 20 additions and 2 deletions
				
			
		
							
								
								
									
										20
									
								
								src/block.rs
									
										
									
									
									
								
							
							
						
						
									
										20
									
								
								src/block.rs
									
										
									
									
									
								
							| 
						 | 
					@ -163,9 +163,12 @@ impl<'s> Parser<'s> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        // trim ending whitespace of block if not verbatim
 | 
					                        // trim ending whitespace of block if not verbatim
 | 
				
			||||||
                        if !matches!(l, Leaf::CodeBlock { .. }) {
 | 
					                        if !matches!(l, Leaf::CodeBlock { .. }) {
 | 
				
			||||||
                            let last = &mut lines[line_count - 1];
 | 
					                            let l = lines.len();
 | 
				
			||||||
 | 
					                            if l > 0 {
 | 
				
			||||||
 | 
					                                let last = &mut lines[l - 1];
 | 
				
			||||||
                                *last = last.trim_end(self.src);
 | 
					                                *last = last.trim_end(self.src);
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        lines
 | 
					                        lines
 | 
				
			||||||
                            .iter()
 | 
					                            .iter()
 | 
				
			||||||
| 
						 | 
					@ -728,6 +731,21 @@ mod test {
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    #[test]
 | 
				
			||||||
 | 
					    fn block_thematic_break() {
 | 
				
			||||||
 | 
					        test_block!("---\n", Block::Leaf(ThematicBreak), "---", 1);
 | 
				
			||||||
 | 
					        test_block!(
 | 
				
			||||||
 | 
					            concat!(
 | 
				
			||||||
 | 
					                "   -*- -*-\n",
 | 
				
			||||||
 | 
					                "\n",   //
 | 
				
			||||||
 | 
					                "para", //
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					            Block::Leaf(ThematicBreak),
 | 
				
			||||||
 | 
					            "-*- -*-",
 | 
				
			||||||
 | 
					            1
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    #[test]
 | 
					    #[test]
 | 
				
			||||||
    fn block_code_block() {
 | 
					    fn block_code_block() {
 | 
				
			||||||
        test_block!(
 | 
					        test_block!(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue