Is there any way to insert a link to a file containing source code, instead of pasting the code directly into the webpage to achieve syntax highlighting? (With the "ability to place virtually anything inside the CDATA without having to escape anything . . .")

<pre class="brush: js">

/home/lawlist/archives/init.el

</pre>
有帮助吗?

解决方案

@beautifulcoder resolved the issue in a related thread:  How to include a file, and wrap its contents in a `pre` tag

<script type="text/javascript">
  var ajaxRq = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Msxml2.XMLHTTP");
  ajaxRq.open("GET", "/home/lawlist/archives/init.el", false);
  ajaxRq.send(null);
  document.write('<pre class="brush:  lisp">');
  document.write(ajaxRq.responseText);
  document.write('</pre>');
</script>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top