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

Does not preserve carriage return #11

Open
Theosakamg opened this issue Jul 31, 2016 · 1 comment
Open

Does not preserve carriage return #11

Theosakamg opened this issue Jul 31, 2016 · 1 comment

Comments

@Theosakamg
Copy link

Console display :

$ ./app/console  project:ota:update
Check if new firmware is available...
Found embeded Firmware for Xxxxx on 0.2.6 (206)

But actualy Html display :

<span style="background-color: black;color: yellow;display: block;">Check if new firmware is available...</span><span style="background-color: black;color: white;display: block;"></span><span style="background-color: black;color: yellow;display: block;">Found embeded Firmware for Xxxxx (heater) on 0.2.6 (206)</span><span style="background-color: black; color: white"></span>

Html should be display :

<span style="background-color: black;color: yellow;">Check if new firmware is available...</span><br/><span style="background-color: black;color: yellow;">Found embeded Firmware for Xxxxx (heater) on 0.2.6 (206)</span>

my code :
In ContainerAwareCommand

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('<comment>Check if new firmware is available...</comment>');
        $output->writeln("<comment>Found Alfred embeded Firmware for $board  on $ver ($version)</comment>");
    }

In Controller

    public function scanAction()
    {
        $output = new BufferedOutput(OutputInterface::VERBOSITY_NORMAL, true );

... Call my command ...

        // return the output
        $converter = new AnsiToHtmlConverter(); //new SolarizedTheme(), true);
        $content = $converter->convert($output->fetch());

        $this->addFlash('sonata_flash_success', "$content");
    }

With :

  • Debian Testing
  • Php 7.0
  • Symfony 2.8
  • Sonata Admin 3.0
@RichardTMiles
Copy link

RichardTMiles commented Feb 12, 2021

I agree this was a tad annoying, though this plugin consistently uses span so this is how I choose to fix this.

preg_replace('##i', '
', (new AnsiToHtmlConverter())->convert(shell_exec('tail -n 25 ' . 'nohup.out'))) :

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants