Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitec097e8

Browse files
committed
support markdown with other language/types
1 parent9a5abd9 commitec097e8

File tree

6 files changed

+23
-168
lines changed

6 files changed

+23
-168
lines changed

‎package-lock.json

Lines changed: 6 additions & 39 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"@types/jsdom":"^12.2.4",
4040
"@types/mocha":"^5.2.7",
4141
"@types/node":"^12.12.5",
42+
"@types/prismjs":"^1.16.0",
4243
"assert":"^2.0.0",
4344
"concurrently":"^5.0.0",
4445
"dotenv":"^8.2.0",

‎web-app/src/components/Markdown/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import markdownEmoji from 'markdown-it-emoji'
55
importprismfrom'markdown-it-prism'
66
import*asReactfrom'react'
77

8-
import'./prism.css'
8+
// load prism styles & language support
9+
import'./prism'
910

1011
// markdown highlighter instance
1112
constmd:MarkdownIt=newMarkdownIt({

‎web-app/src/components/Markdown/prism.css

Lines changed: 0 additions & 127 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Themes - more at https://prismjs.com/examples.html
2+
import'prismjs/themes/prism-tomorrow.css'
3+
4+
// Language support
5+
import'prismjs/components/prism-bash'
6+
import'prismjs/components/prism-clike'
7+
import'prismjs/components/prism-css'
8+
import'prismjs/components/prism-git'
9+
import'prismjs/components/prism-javascript'
10+
import'prismjs/components/prism-json'
11+
import'prismjs/components/prism-sql'
12+
import'prismjs/components/prism-typescript'
13+
// TODO: import all - current list only supports js related

‎web-app/stories/Level.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ storiesOf('Level', module)
8484
steps:[
8585
{
8686
id:'L1:S1',
87-
content:'Should support markdown test\n ```js\nvar a = 1\n```\nwhew it works!',
87+
content:'Should support markdown test\n ```shell\nnpn install some-packagen```\nwhew it works!',
8888
setup:{commits:['a4679b1'],commands:[],files:['package.json']},
8989
solution:{
9090
commits:['7c64508'],

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp