-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: consolidate syntax highlighting code into standalone plugin (#9783
- Loading branch information
Showing
20 changed files
with
231 additions
and
113 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
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
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,25 @@ | ||
/** | ||
* @prettier | ||
*/ | ||
import SyntaxHighlighter from "react-syntax-highlighter/dist/esm/light" | ||
import js from "react-syntax-highlighter/dist/esm/languages/hljs/javascript" | ||
import json from "react-syntax-highlighter/dist/esm/languages/hljs/json" | ||
import xml from "react-syntax-highlighter/dist/esm/languages/hljs/xml" | ||
import bash from "react-syntax-highlighter/dist/esm/languages/hljs/bash" | ||
import yaml from "react-syntax-highlighter/dist/esm/languages/hljs/yaml" | ||
import http from "react-syntax-highlighter/dist/esm/languages/hljs/http" | ||
import powershell from "react-syntax-highlighter/dist/esm/languages/hljs/powershell" | ||
import javascript from "react-syntax-highlighter/dist/esm/languages/hljs/javascript" | ||
|
||
const afterLoad = () => { | ||
SyntaxHighlighter.registerLanguage("json", json) | ||
SyntaxHighlighter.registerLanguage("js", js) | ||
SyntaxHighlighter.registerLanguage("xml", xml) | ||
SyntaxHighlighter.registerLanguage("yaml", yaml) | ||
SyntaxHighlighter.registerLanguage("http", http) | ||
SyntaxHighlighter.registerLanguage("bash", bash) | ||
SyntaxHighlighter.registerLanguage("powershell", powershell) | ||
SyntaxHighlighter.registerLanguage("javascript", javascript) | ||
} | ||
|
||
export default afterLoad |
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
Oops, something went wrong.