Conversation
This allows to remove the use of `echo` and be consistent through out the file. Some empty PHP tags where removed as well.
|
If I am not mistaken, I think some PHP tags were useless. |
|
It does seem strange that there's a seemingly random
Slightly mistaken I believe. The line-break and indentation are hidden in the output that way without needing post-processing. |
I am not sure to understand what you mean. I replaced
Still not sure to understand. No matter how many line breaks, white spaces or tabs you have, the output will be the same in the browser. |
|
I mean the prior situation with the echo seemed surprising. :-)
Whoever wrote it didn't want it to be in the HTML at all. Spaces are collapsed into a single space but that's not the same thing as no space at all. |
|
I see. |
|
The The other changes are fine as well. In code sections used many times (such as in article headers), I am sometimes stripping the white-space to reduce output size, but here, this code is outputted only once, so it does not matter much. The new PR produces this kind of white-space: <div class="day" id="day_before_yesterday">Reçu avant avant-hier <span class="name"></span>
</div> |
|
I understand the idea behind the empty tags now. Maybe we could have some kind of post-processor to remove the overhead of white spaces. But then we have an overhead of processing time. When using template engines (blade, twig, ...), they have options to remove unnecessary white spaces. Maybe we should add that as well. |
|
I am late to the party and want to second @Frenzie |
| ?><span class="name"><?= FreshRSS_Context::$name ?></span><?php | ||
| ?></div><?php | ||
| ?><div class="day" id="day_today"><?= _t('index.feed.received.today') ?> | ||
| <span class="date"> — <?= timestamptodate(time(), false) ?></span> |
There was a problem hiding this comment.
now there is more than 1 space before the —
There was a problem hiding this comment.
maybe it is a good point to remove the — and replace it with CSS because this character is used for styling here. CSS would be the better solution IMHO
There was a problem hiding this comment.
PR welcome if CSS is better. Is there any regression here? If so, can be fixed in #7941
There was a problem hiding this comment.
Like I said, no space is different than a space. Any number of tabs, spaces and newlines are collapsed into a space but that's fundamentally distinct from no space.
Yes, I would not be in favour of using any other layer of processing. There are only a few places where I think we should make an effort with white-space and that can be done with native syntax easily enough. |
Follow-up of FreshRSS#7939
|
A little follow-up #7941 |
* Minor update syntax echo Follow-up of #7939 * Fix layout Whitespace optimisation needed to avoid style glitch
This allows to remove the use of
echoand be consistent through out the file. Some empty PHP tags where removed as well.Pull request checklist:
Additional information can be found in the documentation.