All newlines were stripped in run only mode
Closed this issue · 11 comments
I've this problem when running python code in Docusaurus 3.3.2:
def greet(name):
print(f"Hello, {name}!")
greet("World")
<codapi-snippet sandbox="python" init-delay="500">
</codapi-snippet>
I've also seen this issue #22, @srenatus mentioned that all newlines are stripped in running only mode (without edit mode)
It should be great if this issue can be fixed. Thank you
Can you put together an example on codesandbox, or share the concrete HTML you get for that snippet? I think we'll need that to assess what's happening here.
@srenatus sure, here is the codesandbox URL https://codesandbox.io/p/devbox/peaceful-firefly-3sf4zz?workspaceId=273fe185-9274-4f80-b5dd-33b5233a4574. Then go to docs/intro
or intro.md
file.
I just pasted the snippet code to reproduce the issue:
```python
def greet(name):
print(f"Hello, {name}!")
greet("World")
```
<!-- Not working -->
<codapi-snippet sandbox="python" init-delay="500">
</codapi-snippet>
<!-- Working well -->
<!-- <codapi-snippet sandbox="python" editor="basic" init-delay="500">
</codapi-snippet> -->
Yes, I understand, thank you. Will take a look at it when I have time.
Fixed in 0.19.7.