-
-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,219 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ node_modules | |
tsconfig.tsbuildinfo | ||
tmp | ||
|
||
.DS_Store | ||
.DS_Store | ||
playwright-report/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules/ | ||
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/shiki/src/__tests__/__fixtures__/index_browser.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<html> | ||
<head> | ||
<title>Test Browser</title> | ||
<link rel="modulepreload" href="/dist/index.browser.mjs" /> | ||
<script type="module"> | ||
import { getHighlighter } from './dist/index.browser.mjs' | ||
|
||
const highlighter = await getHighlighter({ | ||
theme: 'nord', | ||
langs: ['html'] | ||
}) | ||
|
||
const code = highlighter.codeToHtml(`<div>My HTML</div>`, { lang: 'html' }) | ||
document.getElementById('output').innerHTML = code | ||
</script> | ||
</head> | ||
<body> | ||
<div id="output"></div> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
packages/shiki/src/__tests__/__fixtures__/index_browser_custom_cdn.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<html> | ||
<head> | ||
<title>Test Browser - Custom CDN</title> | ||
<link rel="modulepreload" href="/dist/index.browser.mjs" /> | ||
<script type="module"> | ||
import { getHighlighter, setCDN, setWasm } from './dist/index.browser.mjs' | ||
|
||
setCDN('/assets') | ||
|
||
const highlighter = await getHighlighter({ | ||
theme: 'nord', | ||
langs: ['html'] | ||
}) | ||
|
||
const code = highlighter.codeToHtml(`<div>My HTML</div>`, { lang: 'html' }) | ||
document.getElementById('output').innerHTML = code | ||
</script> | ||
</head> | ||
<body> | ||
<div id="output"></div> | ||
</body> | ||
</html> |
25 changes: 25 additions & 0 deletions
25
packages/shiki/src/__tests__/__fixtures__/index_browser_custom_paths.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<html> | ||
<head> | ||
<title>Test Browser - Custom Paths</title> | ||
<link rel="modulepreload" href="/dist/index.browser.mjs" /> | ||
<script type="module"> | ||
import { getHighlighter } from './dist/index.browser.mjs' | ||
|
||
const highlighter = await getHighlighter({ | ||
theme: 'nord', | ||
langs: ['html'], | ||
paths: { | ||
languages: '/custom/langs', | ||
themes: '/custom/theme', | ||
wasm: '/custom/bin' | ||
} | ||
}) | ||
|
||
const code = highlighter.codeToHtml(`<div>My HTML</div>`, { lang: 'html' }) | ||
document.getElementById('output').innerHTML = code | ||
</script> | ||
</head> | ||
<body> | ||
<div id="output"></div> | ||
</body> | ||
</html> |
23 changes: 23 additions & 0 deletions
23
packages/shiki/src/__tests__/__fixtures__/index_browser_custom_wasm.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<html> | ||
<head> | ||
<title>Test Browser - Custom Wasm</title> | ||
<link rel="modulepreload" href="/dist/index.browser.mjs" /> | ||
<script type="module"> | ||
import { getHighlighter, setWasm } from './dist/index.browser.mjs' | ||
|
||
const response = await fetch('/assets/dist/onig.wasm') | ||
setWasm(response) | ||
|
||
const highlighter = await getHighlighter({ | ||
theme: 'nord', | ||
langs: ['html'] | ||
}) | ||
|
||
const code = highlighter.codeToHtml(`<div>My HTML</div>`, { lang: 'html' }) | ||
document.getElementById('output').innerHTML = code | ||
</script> | ||
</head> | ||
<body> | ||
<div id="output"></div> | ||
</body> | ||
</html> |
20 changes: 20 additions & 0 deletions
20
packages/shiki/src/__tests__/__fixtures__/index_jsdelivr.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<html> | ||
<head> | ||
<title>Test jsDelivr</title> | ||
<script src="https://cdn.jsdelivr.net/npm/shiki"></script> | ||
<script> | ||
shiki | ||
.getHighlighter({ | ||
theme: 'nord', | ||
langs: ['html'] | ||
}) | ||
.then(highlighter => { | ||
const code = highlighter.codeToHtml(`<div>My HTML</div>`, { lang: 'html' }) | ||
document.getElementById('output').innerHTML = code | ||
}) | ||
</script> | ||
</head> | ||
<body> | ||
<div id="output"></div> | ||
</body> | ||
</html> |
20 changes: 20 additions & 0 deletions
20
packages/shiki/src/__tests__/__fixtures__/index_unpkg.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<html> | ||
<head> | ||
<title>Test unpgk</title> | ||
<script src="https://unpkg.com/shiki"></script> | ||
<script> | ||
shiki | ||
.getHighlighter({ | ||
theme: 'nord', | ||
langs: ['html'] | ||
}) | ||
.then(highlighter => { | ||
const code = highlighter.codeToHtml(`<div>My HTML</div>`, { lang: 'html' }) | ||
document.getElementById('output').innerHTML = code | ||
}) | ||
</script> | ||
</head> | ||
<body> | ||
<div id="output"></div> | ||
</body> | ||
</html> |
Oops, something went wrong.