Skip to content
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

Attribute escaping optimization #961

Closed
mishanga opened this issue Mar 25, 2015 · 3 comments
Closed

Attribute escaping optimization #961

mishanga opened this issue Mar 25, 2015 · 3 comments
Labels

Comments

@mishanga
Copy link
Member

У нас с незапамятных времен в базовых шаблонах BEMHTML функция attrEscape экранирует 4 символа: кавычку, амперсанд и треугольные скобки.
https://github.com/bem/bem-bl/blob/0.2/blocks-common/i-bem/__html/i-bem__html.bemhtml#L238
В bem-core так же: https://github.com/bem/bem-core/blob/v2/common.blocks/i-bem/i-bem.bemhtml#L229
А вот в BT экранируются только кавычка и амперсанд: https://github.com/enb-make/enb-bt/blob/master/lib/bt.js#L802
Я покурил интернетики на эту тему, поэкспериментировал в браузерах и пришел к выводу, что эскейпить треугольные скобки действительно не нужно (это касается только атрибутов).
В BH уже есть фикс: https://github.com/bem/bh/pull/137/files

Если оторвать эскейпинг треугольных скобок, это немного уменьшит время шаблонизации.

@qfox
Copy link
Member

qfox commented Mar 25, 2015

👍 кажется, да.

@aristov
Copy link
Contributor

aristov commented Mar 25, 2015

уменьшит скорость шаблонизации

пывысит?

@aristov aristov closed this as completed Mar 25, 2015
@aristov aristov reopened this Mar 25, 2015
@mishanga
Copy link
Member Author

@aristov хотел сказать "уменьшит время шаблонизации".

narqo pushed a commit that referenced this issue Apr 17, 2015
narqo pushed a commit that referenced this issue Apr 17, 2015
Attribute escaping optimization #961
narqo pushed a commit that referenced this issue Apr 20, 2015
Attribute escaping optimization
@narqo narqo closed this as completed May 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants