-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Strip YAML trailing newline #12253
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
Strip YAML trailing newline #12253
Conversation
Previous YAML resulted in a trailing newline!
@mikemix thanks for this. However, I find this syntax a bit confusing ... if we don't add this, where's the newline added? Is the newline visible to end users in the web page? Thanks. |
@javiereguiluz think of yourself as a regular bloke who wants to translate his app. So he visits the docs and sees the examples. Lets create a simple one: ui:
article_count: >
{count, plural,
one {one article}
other {# articles}
} And lets use it: <h1>Articles ({{ 'ui.article_count'|trans({'count': 5}) }})</h1> You would expect this to be This is because a newline was added (one from the YAML file), the generated html looks as follows: <h1>Articles (5 articles
)</h1> So, in my very humble opinion, either use the The newline is always going to be there, because either there's another translation item in the YAML, or this is the end of the file. AFAIK people usually turn the |
@mikemix you explained it perfectly! Thanks for such a great and detailed explanation. Let's merge this. Thanks ... and congrats on your first Symfony Docs contribution! |
This PR was merged into the 4.3 branch. Discussion ---------- Strip YAML trailing newline Previous YAML resulted in a trailing newline! <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 8cdec91 Strip YAML trailing multiline
…es (javiereguiluz) This PR was merged into the 3.4 branch. Discussion ---------- Yaml: minor syntax issues and expanded multi-line examples Thanks to #12253 (created by @mikemix) I learned about this `>-` syntax ... so I think we should mention it. Commits ------- 79b0c49 Yaml: minor syntax issues and expanded multi-line examples
Previous YAML resulted in a trailing newline!