websvn |
Subversion Repositories: |
Compare with Previous - Blame - Download
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
star-light - version 1.0.2 (2005/06/06)
Copyright 2005, Dean Edwards
License: http://creativecommons.org/licenses/LGPL/2.1/
-->
<public:component xmlns:public="urn:HTMLComponent" lightweight="true">
<public:attach event="ondocumentready" handler="init"/>
<script type="text/javascript">
//<![CDATA[
/* copied from firefox's nice view-source style */
function init() {
// default text colour
style.color = "black";
// comments
parser.add(SGML_COMMENT, "color:green;font-style:italic");
// strings
parser.add(STRING1, "color:blue;font-weight:550");
parser.add(STRING2, "color:blue;font-weight:550");
// indentation
tabStop = 1;
// doctype
parser.add(/<!DOCTYPE[^>]+>/, "color:#4682B4;font-style:italic");
// processing instruction
parser.add(/<\?[\w-]+[^>]+>/, IGNORE);
// script and style blocks
parser.add(/(>([^<][^\/]*<+)*\/)(script|style)>/, "color:#800080;font-weight:bold", "$2<span>$4</span>>");
// tags
parser.add(/(<\/?)(\w+)/, "color:#800080;font-weight:bold", "$2<span>$3</span>");
// atributes
parser.add(/\w+=/, "font-weight:bold");
// entity references (this doesn't work)
parser.add(/&#?\w+;/, "color:#FF4500");
};
//]]>
</script>
</public:component>