SaraVieira / fiddly

Create beautiful and simple HTML pages from your Readme.md files
https://fiddly.netlify.com
MIT License
1.01k stars 39 forks source link

Code between <script></script> transformed #26

Open sandoche opened 5 years ago

sandoche commented 5 years ago

Hi,

In my README.md I have the google analytics code:

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XX-XX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-XX-XX');
</script>

After compiling with fiddly I get this instead:

<!-- Global site tag (gtag.js) - Google Analytics --><script async src="https://www.googletagmanager.com/gtag/js?id=UA-XX-XX"></script>
<script>
  window.dataLayer = window.dataLayer || <a href="undefined"></a>;
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());<br />  gtag('config', 'UA-XX-XX');
</script>  

The [] has ben changed to <a href="undefined"></a>

What can I do to escape it ?