Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: vimdoc should remove whitespace in front of indented code blocks #59

Open
mikesmithgh opened this issue Nov 5, 2023 · 2 comments

Comments

@mikesmithgh
Copy link
Contributor

I have an issue where code blocks are not displaying correctly in some of my nested lists. I am not sure if this is specific to lists or occurs in other scenarios. I have added the steps to reproduce below. The issue that happens is the start of the codeblock > does not have a blank line above it and it has whitespace in front of it causing issues with vim help syntax.

Thanks!

Run the command ./panvimdoc.sh --project-name test-code-block --input-file test-README.md

test-README.md
    # test code blocks
    
    ```lua
        print('code block at root')
        print('code block at root')
        print('code block at root')
    ```
    
    - list
    
        ```lua
            print('code block in list')
            print('code block in list')
            print('code block in list')
        ```
    
      - sublist
        - a
    
            ```lua
                print('a')
                print('a')
                print('a')
            ```
    
        - b
    
            ```lua
                print('b')
                print('b')
                print('b')
            ```
Actual output
*test-code-block.txt*            For             Last change: 2023 November 04

==============================================================================
Table of Contents                          *test-code-block-table-of-contents*

1. test code blocks                         |test-code-block-test-code-blocks|

==============================================================================
1. test code blocks                         *test-code-block-test-code-blocks*

>lua
        print('code block at root')
        print('code block at root')
        print('code block at root')
<

- list
    >lua
            print('code block in list')
            print('code block in list')
            print('code block in list')
    <
    - sublist
        - a
            >lua
                    print('a')
                    print('a')
                    print('a')
            <
        - b
            >lua
                    print('b')
                    print('b')
                    print('b')
            <

Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>

vim:tw=78:ts=8:noet:ft=help:norl:
Expected output
*test-code-block.txt*            For             Last change: 2023 November 04

==============================================================================
Table of Contents                          *test-code-block-table-of-contents*

1. test code blocks                         |test-code-block-test-code-blocks|

==============================================================================
1. test code blocks                         *test-code-block-test-code-blocks*

>lua
        print('code block at root')
        print('code block at root')
        print('code block at root')
<

- list

>lua
            print('code block in list')
            print('code block in list')
            print('code block in list')
<
    - sublist
        - a

>lua
                    print('a')
                    print('a')
                    print('a')
<
        - b

>lua
                    print('b')
                    print('b')
                    print('b')
<

Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>

vim:tw=78:ts=8:noet:ft=help:norl:

Screenshot (actual on left, expected on right)

expected_vs_actual

@kdheepak
Copy link
Owner

Thanks for opening the issue. I've been swamped with work and personal life at the moment, and I'll look into this when I get the chance (hopefully in a few weeks?).

@mikesmithgh
Copy link
Contributor Author

Hey no worries, no rush. 🙂 thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants