Comments (5)
it's just because in the templates there's gonna be something like
class="<?php if (aaa) echo aaaa ?> <?php if(something) echo bbb ?> anotherclass"
which leads to those situations.
it's absolutely normal
from magento-lts.
According to stackoverflow referencing the various docs, it is valid to have leading and trailing spaces in class names.
from magento-lts.
Thank you @kiatng. From what I can see, those discussions are from 10 years ago.
Do you have any idea what would be the reason why the Magento team chose to use leading spaces? Could be a good idea to remove them just for visual effect?
from magento-lts.
As pointed by @fballiano, less clutter in the code.
from magento-lts.
The leading spaces are coming from this function
/**
* Get menu level HTML code
*
* @param array $menu
* @param int $level
* @return string
*/
public function getMenuLevel($menu, $level = 0)
{
$html = '<ul ' . (!$level ? 'id="nav"' : '') . '>' . PHP_EOL;
foreach ($menu as $item) {
if ((empty($item['url']) || ($item['url'] == '#')) && empty($item['children'])) {
continue; // for example hide System/Tools when empty
}
$html .= '<li ' . (!empty($item['children']) ? 'onmouseover="Element.addClassName(this,\'over\')" '
. 'onmouseout="Element.removeClassName(this,\'over\')"' : '') . ' class="'
. (!$level && !empty($item['active']) ? ' active' : '') . ' '
. (!empty($item['children']) ? ' parent' : '')
. (!empty($level) && !empty($item['last']) ? ' last' : '')
. ' level' . $level . '"> <a href="' . $item['url'] . '" '
. (!empty($item['title']) ? 'title="' . $item['title'] . '"' : '') . ' '
. (!empty($item['target']) ? 'target="' . $item['target'] . '"' : '') . ' '
. (!empty($item['click']) ? 'onclick="' . $item['click'] . '"' : '') . ' class="'
. (!empty($item['active']) ? 'active' : '') . '"><span>'
. $this->escapeHtml($item['label']) . '</span></a>' . PHP_EOL;
if (!empty($item['children'])) {
$html .= $this->getMenuLevel($item['children'], $level + 1);
}
$html .= '</li>' . PHP_EOL;
}
$html .= '</ul>' . PHP_EOL;
return $html;
}
Considering that it is not an issue in the source code, I close the report.
from magento-lts.
Related Issues (20)
- Saving product from backend causes destroying category product positions in anchor categories.
- All attributes set to be used for search appear in layering navigation when there are no search results HOT 11
- Loopback for the changes Zend directory HOT 5
- The graphs in the Dashboard page no longer display data HOT 10
- Wrong attributes order in comparison window
- Bug on created_at in customer_entity table on update HOT 4
- Deprecated functionality: strlen(): Passing null to parameter #1
- Deprecated functionality: strlen(): Passing null to parameter #1 - Abstract.php HOT 4
- [Minimal Query Length] issue for search strings of 1 - 2 characters HOT 3
- New EAV attributes not found without cleaning cache
- Zip-Release 20.10.0 incomplete or too many items? HOT 5
- Missing translation new order mail HOT 1
- Question about commit ...
- [Backend] Changing Customer Password - The warning message. HOT 2
- [Backend] Creating New Customer - No message is sent to the customer HOT 3
- Error when saving product with image without description HOT 7
- Main branch does not correspond to the release tag 20.10.2 HOT 4
- Unit tests not run?
- Paypal Credit "See terms" not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magento-lts.