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

Commitefa7580

Browse files
authored
Merge pull requestcoderoad#75 from ShMcK/feature/minor-fixes
Feature/minor fixes
2 parents35cd00f +0041ef1 commitefa7580

File tree

4 files changed

+42
-9
lines changed

4 files changed

+42
-9
lines changed

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

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,49 @@ import './prism'
1010
// markdown highlighter instance
1111
constmd:MarkdownIt=newMarkdownIt({
1212
breaks:true,
13-
// highlight: syntaxHighlight,
1413
html:true,
1514
linkify:true,
1615
})
1716
// add emoji: https://github.com/markdown-it/markdown-it-emoji
1817
.use(markdownEmoji)
18+
// add syntax highlighting through prism
1919
.use(prism,{
2020
defaultLanguage:'js',
2121
})
2222

23+
// const mdFeatures = [
24+
// 'table',
25+
// 'code',
26+
// 'fence',
27+
// 'blockquote',
28+
// 'hr',
29+
// 'list',
30+
// 'reference',
31+
// 'heading',
32+
// 'lheading',
33+
// 'html_block',
34+
// 'paragraph',
35+
// 'html_inline',
36+
// 'autolink',
37+
// 'link',
38+
// 'image',
39+
// ]
40+
41+
// TODO: markdownIt with rules disabling most features
42+
// const minimalMarkdownIt = new MarkdownIt({
43+
// breaks: false,
44+
// html: true,
45+
// linkify: false,
46+
// }).disable(mdFeatures)
47+
2348
interfaceProps{
2449
children:string
50+
minimal?:boolean
2551
}
2652

2753
constMarkdown=(props:Props)=>{
2854
lethtml:string
55+
// TODO: set md to minimal rule set if specified
2956
try{
3057
html=md.render(props.children)
3158
}catch(error){

‎web-app/src/containers/New/TutorialList/TutorialItem.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import*asReactfrom'react'
22
import{css,jsx}from'@emotion/core'
33
importCardfrom'../../../components/Card'
4+
importMarkdownfrom'../../../components/Markdown'
45

56
conststyles={
67
card:{
@@ -39,7 +40,7 @@ const LanguageIcon = () => (
3940
constTutorialItem=(props:Props)=>(
4041
<CardonClick={props.onSelect}css={styles.card}>
4142
<h3>{props.title||'Title'}</h3>
42-
<p>{props.description||'Description'}</p>
43+
<Markdownminimal>{props.description||'Description'}</Markdown>
4344
<divcss={styles.languages}>
4445
<LanguageIcon/>
4546
</div>

‎web-app/src/containers/Overview/OverviewPage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ import * as G from 'typings/graphql'
33
importButtonfrom'../../components/Button'
44
importMarkdownfrom'../../components/Markdown'
55

6+
constfooterHeight=50
7+
68
conststyles={
79
page:{
810
position:'relative'as'relative',
911
display:'flex'as'flex',
1012
flexDirection:'column'as'column',
1113
width:'100%',
14+
paddingBottom:footerHeight,
1215
},
1316
summary:{
1417
padding:'0rem 1rem 1rem 1rem',
@@ -38,7 +41,7 @@ const styles = {
3841
flexDirection:'row'as'row',
3942
alignItems:'center'as'center',
4043
justifyContent:'flex-end'as'flex-end',
41-
height:'50px',
44+
height:footerHeight,
4245
padding:'1rem',
4346
paddingRight:'2rem',
4447
backgroundColor:'black',

‎web-app/src/containers/Tutorial/LevelPage/Level.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const styles = {
1414
display:'flex'as'flex',
1515
flexDirection:'column'as'column',
1616
padding:0,
17-
paddingBottom:'36px',
17+
paddingBottom:72,
1818
height:'auto',
1919
width:'100%',
2020
},
@@ -42,18 +42,20 @@ const styles = {
4242
},
4343
processes:{
4444
padding:'0 1rem',
45-
position:'absolute'as'absolute',
46-
bottom:'36px',
45+
position:'fixed'as'fixed',
46+
bottom:36,
47+
left:0,
48+
right:0,
4749
},
4850
footer:{
4951
display:'flex'as'flex',
5052
flexDirection:'row'as'row',
5153
justifyContent:'space-between',
5254
alignItems:'center',
53-
height:'36px',
55+
height:36,
5456
backgroundColor:'black',
55-
fontSize:'16px',
56-
lineHeight:'16px',
57+
fontSize:16,
58+
lineHeight:16,
5759
padding:'10px 1rem',
5860
position:'fixed'as'fixed',
5961
bottom:0,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp