CMS MADE SIMPLE FORGE

CGExtensions

 

[#11718] cge_prettyhtml or cge_minhtml set to TRUE remove html5 picture tags (not sure it's a major bug)

avatar
Created By: Philippe Thomas (filto)
Date Submitted: Tue Jan 30 11:37:41 -0500 2018

Assigned To: Robert Campbell (calguy1000)
Version: 1.59.1
CMSMS Version: 2.2.5
Severity: Major
Resolution: None
State: Open
Summary:
cge_prettyhtml or cge_minhtml set to TRUE remove html5 picture tags (not sure it's a major bug)
Detailed Description:
in Config Variables, 
if cge_prettyhtml or cge_minhtml is set to TRUE,
html elements <picture> are removed.

I do not know if it is deliberate,
and do not find where to ask it
at  http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/

but i fix it like this :

CGExtensions/lib/htmLawed.php


#---Add the html element picture to elements:
L20 after 
'param'=>1,
add
'picture'=>1,


#---define picture as flow content 
L156 after
'object'=>1,
add
'picture'=>1,

#---define -picture as immediate parent-child for img and source :
L160 after
'option'=>array('#pcdata'=>1),
add
'picture'=>array('img'=>1, 'source'=>1),

#---allow img and source  has childs for pictures
L162 after
'object'=>array('param'=>1, 'embed'=>1),
add
'picture'=>array('source'=>1, 'img'=>1),

#---define picture as inline type for output
L166 after
'output'=>1,
add
'picture'=>1,

#---add srcset  as parameters for source
#---add sizes as parameters for source
L447
'srcset'=>array('img'=>1)
modify
'srcset'=>array('img'=>1,'source'=>1)

'sizes'=>array('link'=>1)
modify
'sizes'=>array('link'=>1,'source'=>1)

Then picture tags are not removed anymore.


History

Comments
avatar
Date: 2019-02-12 06:39
Posted By: Deleted User (deleteduser_11200)

Confirmed 

htmlLawed.php does not work when using the <picture> element, in your source:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture

Modifying the source of: CGExtensions/lib/htmLawed.php is not the solution

I looked at configuration options for htmlLawd but these did not statisfy me:
http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/example_settings.htm

When introducing extra options to CGExtensions the cge_minhtml, configuration
only will become more complicated.

Best to create a Smarty post filter yourself or work with something like
{strip}{/strip} so no unwanted side-effects take place.