Skip to content

[Reference][Twig] Fix typos and formatting #3159

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

Merged
merged 3 commits into from
Nov 7, 2013
Merged

[Reference][Twig] Fix typos and formatting #3159

merged 3 commits into from
Nov 7, 2013

Conversation

bicpi
Copy link
Contributor

@bicpi bicpi commented Nov 6, 2013

Q A
Doc fix? yes
New docs? no
Applies to 2.2+
Fixed tickets -

The line numbers are missing for the Twig+HTML code block in reference/forms/twig_reference.rst. I hope this gets fixed by removing the line feed within the HTML tag. Please let me know if this needs to get fixed in a different way.

@@ -218,8 +218,7 @@ object:

.. code-block:: html+jinja

<label for="{{ form.name.vars.id }}"
class="{{ form.name.vars.required ? 'required' : '' }}">
<label for="{{ form.name.vars.id }}" class="{{ form.name.vars.required ? 'required' : '' }}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't help. The syntax highlighting doesn't work because of the twig condition inside the class attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but what's wrong with the ternary operator - seems to be valid Twig syntax?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that Pygments does not support highlighting Twig. It supports highlighting Jinja (a Python templating language).

And being written for Python devs, Jinja does not support this ternary operator. Instead, it has inline if expressions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this info. So either I revert this change or I fix it with an regular if statement.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest keeping it as it was. This is valid Twig markup.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for keeping the original

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored.

weaverryan added a commit that referenced this pull request Nov 7, 2013
[Reference][Twig] Fix typos and formatting
@weaverryan weaverryan merged commit a2a6d78 into symfony:2.2 Nov 7, 2013
@weaverryan
Copy link
Member

Thanks!

@bicpi bicpi deleted the revise_twig_reference branch January 5, 2014 13:24
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

Successfully merging this pull request may close these issues.

5 participants