Sample dan CSS yang digunakan
CSS (Copy CSS ini ke Template)
.hljs{display:block;overflow-x:auto;padding:.5em;background:#2d2b57;font-weight:400}
.hljs-title{color:#fad000;font-weight:400}.hljs-name{color:#a1feff}
.hljs-tag{color:#fff}
.hljs-attr{color:#f8d000;font-style:italic}
.hljs-built_in,.hljs-section,.hljs-selector-tag{color:#fb9e00}
.hljs-keyword{color:#fb9e00}
.hljs,.hljs-subst{color:#e3dfff}
.hljs-addition,.hljs-attribute,.hljs-bullet,.hljs-code,.hljs-deletion,.hljs-quote,.hljs-regexp,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-string,.hljs-symbol,.hljs-template-tag{color:#4cd213}
.hljs-meta,.hljs-meta-string{color:#fb9e00}.hljs-comment{color:#ac65ff}
.hljs-keyword,.hljs-literal,.hljs-name,.hljs-selector-tag,.hljs-strong{font-weight:400}
.hljs-literal,.hljs-number{color:#fa658d}
.hljs-emphasis{font-style:italic}
.hljs-strong{font-weight:700}
Contoh HTML, XML
<!DOCTYPE html>
<title>Title</title>
<style>body {width: 500px;}</style>
<script type="application/javascript">
function $init() {return true;}
</script>
<body>
<p checked class="title" id='title'>Title</p>
</body>
Contoh JavaScript
function $initHighlight(block, cls) {
try {
if (cls.search(/\bno\-highlight\b/) != -1)
return process(block, true, 0x0F) +
` class="${cls}"`;
} catch (e) {
}
for (var i = 0 / 2; i < classes.length; i++) {
if (checkCondition(classes[i]) === undefined)
console.log('undefined');
}
return (
<div>
<web-component>{block}</web-component>
</div>
)
}
export $initHighlight;