redbrick / static-site

Statically generated site for Redbrick
https://redbrick.dcu.ie
GNU General Public License v3.0
15 stars 21 forks source link

Missing Colons On Site Generation Failing Circleci #312

Closed Frazl closed 6 years ago

Frazl commented 6 years ago

Issue

circleci test is failing because of a script tag that gets automatically put into the html and minified.

<script type="text/javascript">!function(e,a,t,n,c,o,s){e.GoogleAnalyticsObject=c,e[c]=e[c]||function(){(e[c].q=e[c].q||[]).push(arguments)},e[c].l=1*new Date,o=a.createElement(t),s=a.getElementsByTagName(t)[0],o.async=1,o.src="//www.google-analytics.com/analytics.js",s.parentNode.insertBefore(o,s)}(window,document,"script",0,"ga"),ga("create","UA-85359173-1","auto"),ga("send","pageview")</script>

Should be

<script type="text/javascript">!function(e,a,t,n,c,o,s){e.GoogleAnalyticsObject=c,e[c]=e[c]||function(){(e[c].q=e[c].q||[]).push(arguments)},e[c].l=1*new Date,o=a.createElement(t),s=a.getElementsByTagName(t)[0],o.async=1,o.src="//www.google-analytics.com/analytics.js",s.parentNode.insertBefore(o,s)}(window,document,"script",0,"ga"),ga("create","UA-85359173-1","auto"),ga("send","pageview");</script>

It's just missing a ; at the end of the function before the closing of the script tag.

Code still runs perfectly on local host and this missing colon is currently occurring on the master branch. This can be seen on the master branch by loading current site and looking at any html page source code and seeing the missing colon.

I presume this issue is due to an update with the HTMLproofer which gets pulled from a repo everytime the test is run.

Alternatively this could be seen as an issue with the minifier as that's what is removing the colon when minifying. Anyone can easily debate whether or not that colon should be there but the code executes perfectly each time still.

Checklist

I confirm that before I submitted this issue I did the following:

theycallmemac commented 6 years ago

@butlerx any ideas on this?

butlerx commented 6 years ago

this is a check for ; in alt tags thats failing when did the issue first appear

m1cr0man commented 6 years ago

It only seems to have started happening in build 861. Tests post this which succeeded seemed to have skipped the "Test Internal Links" step.

We had a look into changing the minifier options and adding "semicolons: false" (to stop it removing them) to no avail. Also this is a dependency in the theme - totally disjoint from the changes triggering the build. Not sure how to resolve this other than not minifing.

butlerx commented 6 years ago

the issue seems to be coming from the use of & in a tag here These tags appear not to be normalized for HTML eg & -> &amp; the reason for adding a ; in the script tag is probably just a regex quirk

i suggested either using C&amp;S or CandS

theycallmemac commented 6 years ago

I'll fix it, have more announces and minutes to add between today & tomorrow

theycallmemac commented 6 years ago

Closed by #309