Below is what I see when I turn on twig debugging and look at a flag link. ( flag.html.twig )

This is a nit pick ... but I just want to sweep up little things as I see them

My reaction is -- What .. where did all the newlines come from ... that is easy to fix. - spaceless

<!-- BEGIN OUTPUT from 'modules/flag/templates/flag.html.twig' -->


    

<a href="/flag/unflag/bookmark/1?destination=node&amp;token=8NCfuzgS-vkaXRv8_4K80taO4R8sGGpk4DSN6LWBTrs" title="Remove this post from your bookmarks" class="use-ajax flag flag-bookmark flag-bookmark-1 action-unflag">Remove bookmark</a>

<!-- END OUTPUT from 'modules/flag/templates/flag.html.twig' -->
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

martin107 created an issue. See original summary.

martin107’s picture

Assigned: martin107 » Unassigned
Status: Active » Needs review
FileSize
519 bytes

I hope this is quick to review.

martin107’s picture

My mistake --- I has separated a comment from the code is was associated with

gnuget’s picture

Hi martin107

Thanks for your patch.

+++ b/templates/flag.html.twig
@@ -31,3 +32,4 @@ action_class
+{% endspaceless %}
\ No newline at end of file
 

All the files must finish with an empty line or GIT complains.

gnuget’s picture

Status: Needs review » Needs work
martin107’s picture

Status: Needs work » Needs review
FileSize
459 bytes

Fixed.

gnuget’s picture

It is working but I'm not sure about this, looking through the generated code this problem is all over the drupal markup... (not just in the flag module). so... not so sure if we should fix this one in particular if the rest of the code has these spaces. I will leave the status as "needs review" in case someone else wants to comment about this.

Thanks for your patch.

martin107’s picture

Yes core is inconsistent

Just adding information to aid the discussion There are two link type templates in core that use spaceless

link-formatter-link-separate.html.twig
and
file-link.html.twig

socketwench’s picture

Status: Needs review » Reviewed & tested by the community

If other link templates are using spaceless, I think it makes sense for us to do so too.

socketwench’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.