Comments (13)
This could be solved be enabling FullCompatibilityTwigExtension, but that would enable less strict syntax.
from twital.
Is is working correctly with ContextAwareEscapingSubscriber disabled
from twital.
hi! the right syntax for your code should be:
<img t:attr=" true ? src='/a/x.jpg' ">
See http://twital.readthedocs.org/en/latest/tags/attr.html
from twital.
The syntax used by you should work only with FullCompatibilityTwigExtension
enabled. Does it work?
from twital.
I realize that, but it would require rewrite large amount of template code before migration and FullCompatibilityTwigExtension enables a lot of others things.
It is also inconsistent:
<img src="{%if true%}/a/x.jpg{%endif%}">
{# output <img src="%2Fa%2Fx.jpg"> #}
<img src="{{ true ? '/a/x.jpg' }}">
{# output <img src="/a/x.jpg"> #}
from twital.
It make sense, i Will take a look
from twital.
The will be probably somewhere in ContextAwareEscapingSubscriber (esapeUrls?) but I can't find specific place.
from twital.
I'm unable to reproduce the issue (see branch escaping test case I22Test).
Feel free to fork it and create a failing test case.
from twital.
any news in this?
from twital.
@Soukiii ping
from twital.
I am using this test for my quick&dirty fix:
public function testAttributes() {
$this->assertHtml('<img src="/a/x.jpg">', '<img src="{{a}}">', ['a' => '/a/x.jpg']);
$this->assertHtml('<img src="/b/x.jpg">', '<img src="{{ true ? "/b/x.jpg"}}">');
$this->assertHtml('<img src="/c/x.jpg">', '<img src="{%if true%}/c/x.jpg{%endif%}">');
$this->assertHtml('<img src="/d/x.jpg">', '<img src="{%if true%}{{a}}{%else%}{{b}}{%endif%}">', ['a' => '/d/x.jpg', 'b' => '/b/x.jpg']);
}
I will try to look at it later.
from twital.
added test https://github.com/goetas/twital/commits/master no way to reproduce
from twital.
These test were definitely failing with master version which means that you fixed it with some other changes.
from twital.
Related Issues (20)
- Omission of twig expressions HOT 5
- HTML5SourceAdapter ignores Doctype definition HOT 4
- Attributes are duplicated multiple nodes HOT 3
- Removed empty attribute HOT 3
- Missing SourceEvent HOT 1
- Add support fo JSX syntax and React components HOT 2
- How to make an child template be valid XHTML HOT 2
- Symfony 3 support HOT 3
- Add attribute with no value? HOT 3
- Still cannot add attribute with no value. HOT 1
- Documentation for t:content ? HOT 1
- Infinite loop with FixHtmlEntitiesInExpressionSubscriber HOT 5
- Append/Prepend Options For t:block HOT 1
- Question: own twig-functions don´t work HOT 13
- The <t:omit> node sometimes removes children (but not their children) with t:block= HOT 2
- Docs are down
- Request new Release w/ updated deps (masterminds/html5) HOT 1
- Tag a new version for Twig 3 HOT 1
- Twital not working within blocks HOT 4
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 twital.