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

Bugfix single line program #2309

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ascholerChemeketa
Copy link
Contributor

I just discovered the recent program update doesn't handle the case where the contents of <program><code> does not include any newlines. Samples:

<program>print("Hello")</program>
<program><code>print("Hello")</code></program>

substring-before-last is being used to clean up the trailing whitespace, but that template returns '' if there is no newline. So currently, the code in those samples is dropped.

First commit adds a parma to substring-before-last that allows the caller to ask for the $input back if there is no match. That generates clean diffs for sample-book and sample-article in all formats.

Other commits use that to fix pretext-html and adds a test case to the sample article.

Sorry about this one, I missed that this test case was no where in sample-book or article and thus not getting checked.

@ascholerChemeketa ascholerChemeketa force-pushed the bugfix-single-line-program branch from d2891d5 to cec7640 Compare December 10, 2024 18:12
@ascholerChemeketa
Copy link
Contributor Author

Force pushed with new template approach instead of a flag on existing template

@ascholerChemeketa ascholerChemeketa marked this pull request as ready for review December 11, 2024 19:52
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.

1 participant