Open jcubic opened 4 years ago
Part of the issue is that pib is meant to support HTML output windows (e.g. it supports HTML tags). One way to fix this would be to add a setting to the menu to switch from HTML output to text output.
If you want to echo a newline, you'd have to echo "foo<br/>bar"
or use <p>foo</p><p>bar</p>
. I haven't checked why this isn't a space in pib. It could be the way webassembly forwards individual lines to JS, breaking on \n
, but I haven't confirmed that for pib.
https://tysonandre.github.io/phan-demo/ (for https://github.com/tysonandre/phan-demo) is a fork of this that always uses text output (instead of HTML) for running php programs (and adds a PHP static analyzer as an example of an application that can run in web-assembly). That may be a useful reference for implementing an alternative to treat CLI output as plaintext instead of HTML.
@seanmorris maybe you should create PR, but I'm not sure if contribution are accepted.
Example code:
it prints
foobar
and it's not about html ignoring newline, the output is "foobar" in inspector.