0

I am using Jekyll to generate a website, I am using kramdown to parse the markdown. I have a script that I would like to have evaluated inside a table cell. However the script needs a new line in it for kramdown/jekyll to parse it properly. Something like the following:

Cell 1 | Cell 2
Cell 3 | <script>..
</script>
Cell 5 | Cell 6

This doesn't give the desired output of

<table>
    <tr>
        <td>Cell 1</td>
        <td>Cell 2</td>
    </tr>
    <tr>
        <td>Cell 3</td>
        <td><script>...
</script></td>
    </tr>
    <tr>
        <td>Cell 5</td>
        <td>Cell 6</td>
    </tr>
</table>

The actual script I am using (in case it helps) is to hide an email address so it is of the form

<script type="text/javascript">
//<![CDATA[
<!--
var x="function f(x){var i,o=\"\",l=x.length;for(i=0;i<l;i+=2) {if(i+1<l)o+=" +
"x.charAt(i+1);try{o+=x.charAt(i);}catch(e){}}return o;}f(\"ufcnitnof x({)av" +
" r,i=o\\\"\\\"o,=l.xelgnhtl,o=;lhwli(e.xhcraoCedtAl(1/)3=!45{)rt{y+xx=l;=+;" +
"lc}tahce({)}}of(r=i-l;1>i0=i;--{)+ox=c.ahAr(t)i};erutnro s.buts(r,0lo;)f}\\" +
"\"(6),7\\\"\\\\26\\\\04\\\\03\\\\\\\\20\\\\03\\\\00\\\\\\\\13\\\\06\\\\02\\" +
"\\\\\\tF\\\\\\\\31\\\\0I\\\\AL17\\\\0E\\\\ns}p7c17\\\\\\\\19wc4=77\\\\1{\\\\"+
"}p0jP/V)m4rkpl #m]21\\\\06\\\\03\\\\\\\\6R03\\\\\\\\26\\\\0t\\\\\\\\\\\\25\\"+
"\\06\\\\02\\\\\\\\16\\\\00\\\\02\\\\\\\\7403\\\\\\\\33\\\\00\\\\02\\\\\\\\3" +
"5\\\\0n\\\\\\\\\\\\2T00\\\\\\\\30\\\\07\\\\00\\\\\\\\03\\\\00\\\\01\\\\\\\\" +
"05\\\\0E\\\\X:02\\\\06\\\\00\\\\\\\\20\\\\0t\\\\\\\\\\\\>@7b17\\\\\\\\5t<6>" +
",\\\\$\\\\\\\"z\\\\<'=4-:\\\"\\\\\\\\\\\\\\\\((\\\"}fo;n uret}r);+)y+^(i)t(" +
"eAodrCha.c(xdeCoarChomfrg.intr=So+7;12%={y+)i+l;i<0;i=r(foh;gten.l=x,l\\\"\\"+
"\\\\\"\\\\o=i,r va){,y(x fontincfu)\\\"\")"                                  ;
while(x=eval(x));
//-->
//]]>
</script>

EDIT: As parkr suggests I have posted the output below.

I am using Jekyll 1.4.3 and kramdown 1.3.1.

Kramdown just seems to wrap the whole thing in a pragaraph, i.e I get the following output.

<p>e: | <script>...
...</script>
p: | +44 131 651 7671
a: | Room 5402, School of Mathematics
   | James Clerk Maxwell Building
   | King’s Buildings
   | Edinburgh, EH9 3JZ</p>
noaham
  • 153
  • 1
  • 4

1 Answers1

0

Unfortunately, kramdown doesn't currently allow newlines in tables — see this issue for a proposal regarding changing that.

Kyle Barbour
  • 985
  • 8
  • 25