You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anything in either a fenced block or indented by 4 spaces/tab blindly executes.
Steps to Reproduce the Problem
Save text of this issue as a .md file
Execute it using zx
I am finding the ability of zx to execute scripts written as .md files very useful from a documentation PoV.
The actual executable part works well, ex:
$`echo "Example script execution in fenced block with a js language tag"`;
$`echo "Example script execution in a fenced block without any language tag"`;
$`echo "Example script execution in indented block"`;
But if I want to document some piece of code within the markdown file, I have an issue. So for example,
maybe I want to explain how to run it via some aliased command in my npm scripts block:
Anything in either a fenced block or indented by 4 spaces/tab blindly executes.
Steps to Reproduce the Problem
Save text of this issue as a .md file
Execute it using zx
I am finding the ability of zx to execute scripts written as .md files very useful from a documentation PoV.
The actual executable part works well, ex:
$`echo "Example script execution in fenced block with a js language tag"`;
$`echo "Example script execution in a fenced block without any language tag"`;
$`echo "Example script execution in indented block"`;
But if I want to document some piece of code within the markdown file, I have an issue. So for example,
maybe I want to explain how to run it via some aliased command in my npm scripts block. But that will just
cause the script to explode.
So when I just glanced at that function, I thought I could use a different language tag (well, anything except js).
yarn runscript ./scripts/example.md
And the little parser manages to ignore it. But then the parsing breaks and it tries to execute this line here instead. Looking at the function, I see why, and I'm currently [naïvely] dealing with this by patching the package, removing the ability to parse indented code blocks as part of the output, then just indenting any examples.