Skip to content

Commit 9689200

Browse files
committed
doc: Fix typo issue for renderToHTML
1 parent e35decf commit 9689200

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ The default functionality of rendering code blocks would use `codeToHtml` from t
372372
If you want to render the tokens into a code yourself, Shiki exposes two key methods to do that.
373373
374374
- `codeToThemedTokens` takes a code string and a language id and returns an array of tokens. A token represents a single part of the code, for example a keyword, a string, a comment, etc.
375-
- `renderToHTML` takes an array of tokens and returns an HTML string that represents the provided code.
375+
- `renderToHtml` takes an array of tokens and returns an HTML string that represents the provided code.
376376
377377
```js
378378
import shiki, { getHighlighter } from 'shiki'
@@ -389,15 +389,15 @@ const code = `console.log("Here is your code.");`
389389
const tokens = highlighter.codeToThemedTokens(code, 'javascript')
390390

391391
// This will return an HTML string that represents the provided code.
392-
const html = shiki.renderToHTML(tokens)
392+
const html = shiki.renderToHtml(tokens)
393393
```
394394
395-
Alternatively you can add to `renderToHTML` the desired element shape for `pre`, `code`, `line (span)`, and `token (span)`, and override the theme colors for background and foreground.
395+
Alternatively you can add to `renderToHtml` the desired element shape for `pre`, `code`, `line (span)`, and `token (span)`, and override the theme colors for background and foreground.
396396
397397
For more about that, or to build your own renderer, check out the implementation in [shiki](./packages/shiki/src/renderer.ts).
398398
399399
```js
400-
const html = shiki.renderToHTML(tokens, {
400+
const html = shiki.renderToHtml(tokens, {
401401
fg: highlighter.getForegroundColor('nord'), // Set a specific foreground color.
402402
bg: highlighter.getBackgroundColor('nord'), // Set a specific background color.
403403
// Specified elements override the default elements.

0 commit comments

Comments
 (0)