Skip to content

Instantly share code, notes, and snippets.

@jjarava
Created September 7, 2015 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjarava/9596855f9f1ff9720167 to your computer and use it in GitHub Desktop.
Save jjarava/9596855f9f1ff9720167 to your computer and use it in GitHub Desktop.
Example file for `mdless` issue #2 (https://github.com/ttscoff/mdless/issues/2) - Don't you love the fact you can't add attachments to Issues in GitHub??

Testing mdless sample file:

Here are 4 examples of a code snippet inserted in differente ways.

Snippet 1: - Using triple back quotes and specifying the language (ref: http://brettterpstra.com/2015/08/24/write-better-markdown/#fenced-code-blocks)

<script type="text/javascript">
(function() {
    document.cookie = "COOKIE_NAME=" + encodeURIComponent(Math.random()) + ";path=/;domain=DOMAIN-HERE";
})();
</script> 

Snippet 2: - Indenting the code block

<script type="text/javascript">
(function() {
	document.cookie = "COOKIE_NAME=" + encodeURIComponent(Math.random()) + ";path=/;domain=DOMAIN-HERE";
})();
</script> 

Snippet 3: - Using triple back quotes without specifying the language:

<script type="text/javascript">
(function() {
    document.cookie = "COOKIE_NAME=" + encodeURIComponent(Math.random()) + ";path=/;domain=DOMAIN-HERE";
})();
</script> 

Snippet 4: - Using a single back tick in every line (ugly! and probably invalid Markdown?)

<script type="text/javascript"> (function(){ var f=document,e=window,i=e.location.protocol,b=[["src",[i=="https:"?"https:/":"http:/","HOST-HERE/TRUSTEER-ID-HERE/FILE-NAME-HERE.js"].join("/")],["type","text/javascript"],["async",true]],g="XMLHttpRequest",a=null,j=e[g]&&(a=new e[g]()).withCredentials!==undefined,c=f.createElement("script"),h=f.getElementsByTagName("head")[0];if(j){a.open("GET",b[0][1],b[2][1]);a.withCredentials=true;a.onreadystatechange=function(d){if(a.readyState==4&&a.status==200){c.type="script/meta";c.src=b[0][1];h.appendChild(c);new Function(a.responseText)()}};a.send()}else{setTimeout(function(){for(var d=0,k=b.length;d<k;d++){c.setAttribute(b[d][0],b[d][1])}h.appendChild(c)},0)}})(); </script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment