Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Added missing Prism.highlight parameter #1774

Merged
merged 1 commit into from
Mar 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions extending.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,18 @@ <h2>Parameters</h2>
</section>

<section id="highlight">
<h1><code>Prism.highlight(text, grammar)</code></h1>
<h1><code>Prism.highlight(text, grammar, language)</code></h1>
<p>Low-level function, only use if you know what you’re doing.
It accepts a string of text as input and the language definitions to use, and returns a string with the HTML produced.</p>
It accepts a string of text as input, the language definitions to use, and the name of the language, and returns a string with the HTML produced.</p>

<h2>Parameters</h2>
<dl>
<dt>text</dt>
<dd>A string with the code to be highlighted.</dd>
<dt>grammar</dt>
<dd>An object containing the tokens to use. Usually a language definition like <code>Prism.languages.markup</code></dd>
<dt>language</dt>
<dd>The name of the language definition passed to <code>grammar</code>. E.g. <code>markup</code> or <code>javascript</code></dd>
</dl>

<h2>Returns</h2>
Expand Down