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

Markdown exportation ignores indentations of code snippet block #62

Open
pandavas89 opened this issue Feb 22, 2024 · 1 comment · May be fixed by #63
Open

Markdown exportation ignores indentations of code snippet block #62

pandavas89 opened this issue Feb 22, 2024 · 1 comment · May be fixed by #63

Comments

@pandavas89
Copy link

Steps to Reproduce
create code snippet indented to ordered list as follows:

1. lorem ipsum dolor
2. lorem ipsum dolor
    ```
    my_code_block
    ```
3. lorem ipsum dolor 
4. lorem ipsum dolor

Expected Result

1. lorem ipsum dolor
2. lorem ipsum dolor
    ```
    my_code_block
    ```
3. lorem ipsum dolor 
4. lorem ipsum dolor

Actual Result

1. lorem ipsum dolor
2. lorem ipsum dolor
'''
my_code_block
'''
1. lorem ipsum dolor 
2. lorem ipsum dolor
  • backtick inside codeblock was replaced with quotation, for it breaks the codeblock
@pavan-uppari
Copy link

Issue: Adding indentations for child blocks is handled such that it will be single line. But it can be string with multiple lines.

Solution: textwrap package provides indent method which adds indentation for multiline string.

Ref:

  1. https://docs.python.org/3/library/textwrap.html#textwrap.indent
  2. https://stackoverflow.com/questions/8234274/how-to-indent-the-contents-of-a-multi-line-string

Created #63 to fix the issue.

@echo724 please review and merge

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

Successfully merging a pull request may close this issue.

2 participants