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

Dump in html format will cause jquery issues #864

Closed
da-wen opened this issue Jun 7, 2016 · 3 comments
Closed

Dump in html format will cause jquery issues #864

da-wen opened this issue Jun 7, 2016 · 3 comments

Comments

@da-wen
Copy link

da-wen commented Jun 7, 2016

Before i create a pull request i want others to confirm #on that issues.
I think it happens only with newer versions of console component.

When you are dumping you api docs like this
bin/console api:doc:dump --env=dev --format=html > web/content-api.html
and open the generated html, the javascript is broken and gives you errors like this:
content-api.html:646 Uncaught SyntaxError: Unexpected token ILLEGAL content-api.html:4023 Uncaught ReferenceError: $ is not defined

I checked the file located under Resources/public/js/all.js and compared it with the generated file and figured out, that all << were ripped out.

Here an example from online compare editor:
Base file: X[V << 1] = Z++;
Generated file: X[V\1] = Z++;

I went through the Formatter and everything was fine, but i recognized that the console->writeln is causing that issue.
I think console component has update some of their formatters.

A fix for that is to make the output raw.
Current:
$output->writeln($formattedDoc);

Fixed:
$output->writeln($formattedDoc, OutputInterface::OUTPUT_RAW);

@Gregoire-M
Copy link

Hi,
Same problem here with 2.12.0
Your fix works fine for me.

@Gregoire-M
Copy link

@willdurand Could you tag a new version please?

@willdurand
Copy link
Collaborator

I will but test suite is failing right now. Must be fixed first.

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

3 participants