---
title: API
encoding: utf-8
filter:
  - erb
  - maruku
---
### SyntaxHighlighter.Highlighter.prototype.forHtmlScript(args)

SyntaxHighlighter 2.0 introduced ability to mix any brush with HTML. For example, this allows to display JavaScript or PHP in the context of HTML page. To allow a brush to use html-script functionality, it needs to be prepared by calling `this.forHtmlScript(...)` from the constructor. 

`args` 
:	`Object: { left: /RegExp/, right: /RegExp/ }`
	Where `left` regular expression matches opening tag indicating beginning of the script code block, and `right` regular expression matches closing tag. Whatever's in between the two will be highlighted using the actual brush. Everything outside will be treated as HTML. 

#### Example

<pre class="brush: js">
SyntaxHighlighter.brushes.JScript = function()
{
	...
	this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
};
</pre>

<%= render(:partial => "/SyntaxHighlighter/partials/api") %> 
<%= render(:partial => "/SyntaxHighlighter/partials/api_highlighter") %> 
