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

make newline optional at the end of code blocks #51

Merged
merged 2 commits into from
Jul 1, 2024
Merged

make newline optional at the end of code blocks #51

merged 2 commits into from
Jul 1, 2024

Conversation

lilacstella
Copy link
Contributor

@lilacstella lilacstella commented Jun 27, 2024

This PR resolves #50 where code blocks in the output markdown file are not executed if there is no newline after the code block in the source file. The output markdown file would then result in having the original text rather than the intended output command execution and its output.

Fix Description

The fix modifies the code block detection logic in rundoc to ensure it correctly handles code blocks that do not have a newline character following them. This ensures that all code blocks are executed and their outputs are properly embedded in the generated markdown file.

Testing

  • Added a unit test to ensure that code blocks without a trailing newline are parsed in the same manner as those that do
  • Previous unit tests with code blocks that do have trailing newlines are still passing

@lilacstella lilacstella marked this pull request as ready for review June 27, 2024 20:13
@lilacstella lilacstella requested a review from schneems June 27, 2024 20:32
@lilacstella lilacstella changed the title make newline optional at the end of codeblocks make newline optional at the end of code blocks Jul 1, 2024
@lilacstella lilacstella linked an issue Jul 1, 2024 that may be closed by this pull request
@schneems
Copy link
Member

schneems commented Jul 1, 2024

Thank you! This is great.

@schneems schneems merged commit 62e49c4 into zombocom:main Jul 1, 2024
7 checks passed
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 this pull request may close these issues.

New line required after code blocks in source file
2 participants