-
Notifications
You must be signed in to change notification settings - Fork 49
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
Code cell in blockquote does not execute #1134
Comments
Ah, it looks like the selector is wrong I hadn't thought about executable nodes being nested inside quotes. I didn't think we wanted to support that kind of usage, but I have not personally given it much thought (and I reckon I'd be in favour of it). The issue is that our version of I'll give this some cycles on Monday, when I'm back in the office, but anyone else is welcome to tackle it! |
I think there are some quick tightening we can do, including labelling the block on the way through. The other block is actually a markdown cell, which happens to contain a code-cell. Not allowed in Jupyter Notebooks, but probably fine to allow here, and I kinda like that it should work. The other selector should at least look for an executable code cell. That would have made it "work" but the one cell would be executed twice. I think the better plan is to use the |
@agoose77 I have put together a fix in #1136 by changing I think it is good for the cell kind to be a known attribute of the block. |
The following nested code-cell fails execution.
This is the AST:
The failure:
![image](https://private-user-images.githubusercontent.com/913249/323751605-b745754c-4e40-46af-bb89-98a373c58673.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg3MDYwMDgsIm5iZiI6MTcxODcwNTcwOCwicGF0aCI6Ii85MTMyNDkvMzIzNzUxNjA1LWI3NDU3NTRjLTRlNDAtNDZhZi1iYjg5LTk4YTM3M2M1ODY3My5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjE4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYxOFQxMDE1MDhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01ZjJkM2Y3ZjlkOTg2NjFjZTQzYTI4ZTZhYzc1NjY5MGMxNmQ1ZDJmOTA3ZGY1MTFhNjEzYWIxNDU4ZTQ1Yzc4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.bU_kMAkqdaTJYyULpAqEE-ykcbsd1T4Ow10XRufa2bk)
That is the markdown cell that we are trying to execute in python.
The selection here:
https://github.com/executablebooks/mystmd/blob/bug/code-block/packages/myst-execute/src/execute.ts#L282
it does not take into account nested blocks, and/or special blocks that should only contain a code/output pair.
Instead there is a block that contains a code-cell.
The next error is here:
https://github.com/executablebooks/mystmd/blob/bug/code-block/packages/myst-execute/src/execute.ts#L120
Which I think needs an executable flag on it.
Regardless, needs some more test cases on these nested select cases, and/or being more specific about the block we are filtering for.
The text was updated successfully, but these errors were encountered: