-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
No output without print and no line breaks #25
Comments
Hello, thanks for the report. Remember that the output is treated as Markdown by default, and rendered to HTML, so line breaks will lose their effect once converted to HTML. ```pycon exec="on" source="console"
>>> x=1
>>> y=2
>>> print(x)
>>> print(y)
``` That covers your second point. I'm not sure how we could solve the first point. We'd have to somehow detect that the last line didn't use |
Can we borrow some logic from python repl? Ideally i would expect |
I don't know, I never looked at its code 🙂 Would you like to investigate and send a PR? |
I will try. I find |
Describe the bug
First of all, thanks for this very nice plugin. There are two issues, probably related:
Output is only generated with print, not by calling the variable/object.
This will produce nothing:
'''python exec="on" source="material-block"
x=1
x
'''
This will work:
'''python exec="on" source="material-block"
x=1
print(x)
'''
1
Line breaks are not respected.
This will print the two numbers next to each other, rather than below each other.
'''python exec="on" source="material-block"
x=1
y=1
print(x)
print(y)
'''
1 2
Expected behavior
I would expect the output to be as in the console, so that the code examples are representative of real use.
System (please complete the following information):
Markdown Exec
version: 1.6.0Boost priority
The text was updated successfully, but these errors were encountered: