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

Extra slashes // in magic command output? and None if Python code does not print anything to stdout... #405

Open
luckman212 opened this issue Feb 25, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@luckman212
Copy link

macOS 15.3.1 + Obsidian 1.8.7

// slashes

Not sure if it changed since 2.1.0 but... @vault_url is generating double slashes in its output

print("Vault url:", @vault_url)
Image

None output

Also, if there is nothing printed to stdout, the codeblock displays the text None. Pretty sure that isn't intentional either.

print("Vault url:", @vault_url)

vs

print('hello')
print("Vault url:", @vault_url)
Image
@twibiral twibiral added the bug Something isn't working label Mar 1, 2025
@luckman212
Copy link
Author

Just reporting, with 2.1.2 ... still the same.

Example, I would expect the below to only show the image, but None is printed as well

Image

@twibiral
Copy link
Owner

twibiral commented Mar 2, 2025

Thanks for checking @luckman212 ! Are you executing the code in notebook mode? (That would explain the None)

If you try print("Vault url:", @vault_url) again, does it still print the wrong path? Hopefully I was at least able to fix that part...

@luckman212
Copy link
Author

Yes @twibiral the double slash problem is fixed 🚀

Not sure what you mean "notebook mode" - reading mode? If that's what you meant then "Yes" I am executing the codeblocks in Reading Mode. I still use the split-pane view (left side "source" mode and right side "reading" mode, I am most comfortable with this setup (I don't use Live Preview mode).

@luckman212
Copy link
Author

Oh I see Notebook Mode is in the Plugin settings... sorry. I didn't realize, not sure what that setting does yet, I will try to learn about it.

Anyway "yes" the Notebook Mode toggle was "On", I also tried turning it Off which did not make a difference.

@twibiral
Copy link
Owner

twibiral commented Mar 2, 2025

@luckman212 The notebook mode creates a global environment for the code you run, similar to Jupyter notebook. It works fine most times, but sometimes it has some funky issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants