JSFiddle - React, Tailwind, and code Playground
by codyc54321
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<p>Enter your Ipython text and I'll clean it up</p>
<form action"." method="post">
<input type='hidden' name='csrfmiddlewaretoken' value='inYPMbWKLTwwIdSHYbcfYwWWIKicgglj' />
<div style=""><p><label for="id_code">Code:</label> <textarea cols="40" id="id_code" name="code" rows="10">
In [9]: match = re.match(in_rgx, string)
In [10]: match
Out[10]: <_sre.SRE_Match at 0x7f90674cf3d8>
In [11]: match.gro
match.group match.groupdict match.groups
In [11]: match.group()
Out[11]: 'In [3]: '
</textarea></p></div>
<div style="clear:left;"><input type="submit" value="Submit"/></div>
</form>
<br/>
<button onclick="copyToClipboard('#clean-code')">Copy to clipboard</button>
<br/>
<p id="clean-code">match = re.match(in_rgx, string)<br /><br />match<br />#<_sre.SRE_Match at 0x7f90674cf3d8><br /><br />match.gro<br />match.group match.groupdict match.groups <br /><br />match.group()<br />#'In [3]: '<br /></p>
<form action"." method="post">
<input type='hidden' name='csrfmiddlewaretoken' value='inYPMbWKLTwwIdSHYbcfYwWWIKicgglj' />
<div style=""><p><label for="id_code">Code:</label> <textarea cols="40" id="id_code" name="code" rows="10">
match = re.match(in_rgx, string)
match
#<_sre.SRE_Match at 0x7f90674cf3d8>
match.gro
match.group match.groupdict match.groups
match.group()
#'In [3]: '
</textarea></p></div>
<div style="clear:left;"><input type="submit" value="Submit"/></div>
</form>
JavaScript
function copyToClipboard(element) {
var $temp = $("<input>");
$("body").append($temp);
$temp.val($(element).text()).select();
document.execCommand("copy");
$temp.remove();
}