Okay I’ve actually made it accept javascript as a link by adding
function ss_allow_javascript_protocol( $protocols ){
$protocols[] = 'javascript';
return $protocols;
}
add_filter( 'kses_allowed_protocols' , 'ss_allow_javascript_protocol' )
to functions.php (from here)
and made it stop cutting characters out of the code by adding
function myclean_url( $url, $original_url ) {
return esc_html( $original_url );
}
add_filter( 'clean_url', 'myclean_url', 10, 2 );
also to functions.php (from here)
But, wordpress still removes the final semicolon from the end of the code, which I need for it to work.
In the URL section of formatting.php it has code that removes certain trailing characters, but even if I take semicolon out of that or remove that part of the file completely, it still removes it.
Any ideas?