Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: 片段阅读错题集 #66

Merged
merged 4 commits into from
Jun 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/assets/mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,15 @@
"type": "公考",
"subType": "言语理解与表达",
"category": "markdown"
},
{
"id": "9c44d7d3145e382d441fe81ef477e4c6",
"title": "片段阅读错题集",
"url": "./assets/mapping/9c44d7d3145e382d441fe81ef477e4c6.json",
"createTime": 1561015817211,
"modifyTime": 1561083717433,
"type": "公考",
"subType": "言语理解与表达",
"category": "markdown"
}
]
279 changes: 279 additions & 0 deletions src/assets/markdown/9c44d7d3145e382d441fe81ef477e4c6.md

Large diffs are not rendered by default.

88 changes: 44 additions & 44 deletions src/assets/markdown/edabfb3a75ee39f82ad29e384d04dc0b.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/pages/MarkdownEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import Markdown from 'react-markdown/with-html';
import MarkDownDetail from './MarkdownDetail';
import { Col, Row, Input, Button } from 'antd';
const { TextArea } = Input;

Expand Down Expand Up @@ -61,7 +61,7 @@ export default class MarkdownEditor extends Component<
fontSize: 16,
}}
>
<Markdown source={textareaValue} escapeHtml={false} />
<MarkDownDetail dataSource={textareaValue} />
</Col>
<Col span={8} push={8} style={{ marginTop: 24 }}>
<Button block onClick={this.handleSave}>
Expand Down
62 changes: 39 additions & 23 deletions src/pages/__tests__/__snapshots__/MarkdownEditor.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -91,33 +91,49 @@ exports[`MarkdownEditor render correctly 1`] = `
}
}
>
<ReactMarkdownWithHtml
astPlugins={Array []}
escapeHtml={false}
plugins={Array []}
rawSourcePos={false}
renderers={Object {}}
skipHtml={false}
source="testDataSource"
sourcePos={false}
transformLinkUri={[Function]}
<Component
dataSource="testDataSource"
>
<Root
key="root-1-1"
<div
className="MarkdownDetail"
>
<p
key="paragraph-1-1"
<div
className="wrapper"
>
<TextRenderer
key="text-1-1"
nodeKey="text-1-1"
value="testDataSource"
<div
className="content"
>
testDataSource
</TextRenderer>
</p>
</Root>
</ReactMarkdownWithHtml>
<ReactMarkdownWithHtml
astPlugins={Array []}
escapeHtml={false}
plugins={Array []}
rawSourcePos={false}
renderers={Object {}}
skipHtml={false}
source="testDataSource"
sourcePos={false}
transformLinkUri={[Function]}
>
<Root
key="root-1-1"
>
<p
key="paragraph-1-1"
>
<TextRenderer
key="text-1-1"
nodeKey="text-1-1"
value="testDataSource"
>
testDataSource
</TextRenderer>
</p>
</Root>
</ReactMarkdownWithHtml>
</div>
</div>
</div>
</Component>
</div>
</Col>
<Col
Expand Down
10 changes: 10 additions & 0 deletions src/pages/css/MarkdownDetail.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,13 @@
position: relative;
margin: 5% 0;
}

.MarkdownDetail .wrapper .content span {
background: #444;
transition: background 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.MarkdownDetail .wrapper .content span:hover {
background: #fff;
transition: background 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}