5c782cd fix bug preventing indented literal blocks

2 files Authored by Zandr Martin 4 years ago, Committed by ddevault 4 years ago,
    fix bug preventing indented literal blocks
    
    This commit fixes a bug in parsing indented literal blocks. For example:
    
    test(8)
    
    	```
    	This is a block
    	```
    
    Prior to this commit, this would fail, but with an unexpected error
    message: "Error at 4:3: Cannot deindent in literal block". The
    indentation was being parsed at every character, so the parser saw the
    `T`, then parsed indentation again. The indentation was 0 (since there
    were no tab characters between the `T` and the `h`), but the block
    started with an indentation level of 1. 0 < 1, so this would be
    considered a dedent, which is not allowed.
    
    This commit introduces a new local variable, `check_indent`, which
    controls whether the parser tries to parse indentation or not; now
    indentation is only parsed when the last character was a newline. From
    my testing this seems to fix the issue - indented literal blocks are now
    allowed.
    
        
file modified
+15 -8
file modified
+21 -0