Używam Antisamy do sprawdzania poprawności HTML. Moje zasady dopuszczają elementy iframe, takie jak filmy youtube. Problem polega na tym - jeśli znacznik jest pusty (tak):Antisamy parser force tag zamykający
<iframe src="//www.youtube.com/embed/uswzriFIf_k?feature=player_detailpage" allowfullscreen></iframe>
niż po czyszczeniu to będzie tak:
<iframe src="//www.youtube.com/embed/uswzriFIf_k?feature=player_detailpage" allowfullscreen/>
Ale to powinno mieć normalny znacznik zamykający.
A to przerywa całą zawartość na stronie po. już ustawić moje wskazówki, aby korzystać z większości HTML, ale nie XML:
<directives>
<directive name="omitXmlDeclaration" value="true"/>
<directive name="omitDoctypeDeclaration" value="true"/>
<directive name="maxInputSize" value="200000"/>
<directive name="nofollowAnchors" value="true" />
<directive name="validateParamAsEmbed" value="true" />
<directive name="useXHTML" value="false"/>
<directive name="embedStyleSheets" value="false"/>
<directive name="connectionTimeout" value="5000"/>
<directive name="maxStyleSheetImports" value="3"/>
<directive name="formatOutput" value="false"/>
</directives>
Ale to nie pomaga.
UPD: przełączanie między analizatorami składni i granie z dyrektywami nadal nie dawało żadnych wyników.
UPD2: jest to część mojej konfiguracji, odpowiedzialny za obsługę iframe
tag:
<tag name="iframe" action="validate">
<attribute name="src">
<regexp-list>
<regexp name="youtube"/>
<regexp name="slideshare"/>
</regexp-list>
</attribute>
<attribute name="allowfullscreen">
<regexp-list>
<regexp name="anything"/>
</regexp-list>
</attribute>
<attribute name="scrolling">
<regexp-list>
<regexp name="anything"/>
</regexp-list>
</attribute>
<attribute name="marginwidth">
<regexp-list>
<regexp name="anything"/>
</regexp-list>
</attribute>
<attribute name="marginheight">
<regexp-list>
<regexp name="anything"/>
</regexp-list>
</attribute>
<attribute name="frameborder">
<regexp-list>
<regexp name="anything"/>
</regexp-list>
</attribute>
<attribute name="style"/>
</tag>
jakiś pomysł?
Wiem 4 lat minęło .... ale przez przypadek, może pamiętasz, czy udało ci się to rozwiązać? Chwytanie słomek przez ostatnie dwa dni – Rohan210