Closed opuu closed 2 years ago
@opuu Can you try to pull request a fix for those two issues?
@nunomaduro I'll try. Have you tested this on windows? I am getting the same result on CMD, PowerShell and Windows Terminal. But on Linux and Visual Studio Code integrated terminal it seems to work as expected.
And adding libxml_use_internal_errors(true);
after constructing the DOMDocument class fixes the parser issue but this may omit other errors and warnings as well, which needs to be manually handled.
cc @xiCO2k
@opuu thanks for the report, we did not spent anytime checking it on Windows, but we need too. Thanks for bringing that to the table.
@opuu We will probably need to have the LIBXML_NOERROR added to have support for the HTML5 tags like <header>
so that could be a solution for this issue
@xiCO2k Yes adding LIBXML_NOERROR to loadHTML will fix the issue.
It will also stop showing errors for invalid html. But this should not be a problem as the ending tag is automatically generated from the starting tag, and termwind is replacing unsupported tags with div.
<?php
$dom = new DOMDocument();
$dom->loadHTML('<header data-attribute="foo">bar<', LIBXML_NOERROR | LIBXML_COMPACT | LIBXML_HTML_NODEFDTD | LIBXML_NOBLANKS | LIBXML_NOXMLDECL);
echo $dom->saveHTML();
?>
And here is the official documentation from Microsoft about text formatting on console.
Yes if you to contribute with that change I will be happy to review!
@xiCO2k After spending hours debugging the code, I found nothing wrong that can cause the color issue, reading symphony console documentation I found that windows command console does not support ANSI by default. You have to enable it, and the process is very dirty.
By default, the Windows command console doesn't support output coloring. The Console component disables output coloring for Windows systems, but if your commands invoke other scripts which emit color sequences, they will be wrongly displayed as raw escape characters. Install the Cmder, ConEmu, ANSICON, Mintty (used by default in GitBash and Cygwin) or Hyper free applications to add coloring support to your Windows command console.
I am creating a PR for the HTML5 compatibility issue.
Thanks @opuu. Really appreciate your time. Looking forward to the PR.
Default colors are not being applied to html element on windows terminal (using windows sub system for linux). Also the parser trying to parse special characters as html, in this case <== gives an warning.
Output