Skip to content

Commit eb99d69

Browse files
committed
Markdown rendering fixes
1 parent b031ad3 commit eb99d69

File tree

4 files changed

+39
-6
lines changed

4 files changed

+39
-6
lines changed

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,14 @@
143143
"redux": "^3.7.2",
144144
"redux-actions": "^2.4.0",
145145
"redux-promise": "^0.6.0",
146-
"remark-breaks": "^2.0.2",
147146
"rehype-katex": "^5.0.0",
147+
"rehype-raw": "^5.1.0",
148+
"rehype-stringify": "^8.0.0",
149+
"remark-breaks": "^2.0.2",
148150
"remark-frontmatter": "^3.0.0",
149151
"remark-gfm": "^1.0.0",
150-
"remark-parse": "^9.0.0",
151-
"rehype-stringify": "^8.0.0",
152152
"remark-math": "^4.0.0",
153+
"remark-parse": "^9.0.0",
153154
"request-ip": "^2.0.2",
154155
"require-context": "^1.1.0",
155156
"rss": "^1.2.2",

src/shared/components/challenge-detail/Specification/SpecificationComponent/index.jsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import remarkGfm from 'remark-gfm';
77
import remarkParse from 'remark-parse';
88
import rehypeStringify from 'rehype-stringify';
99
import remarkFrontmatter from 'remark-frontmatter';
10+
import rehypeRaw from 'rehype-raw';
11+
import remarkBreaks from 'remark-breaks';
12+
import style from './styles.scss';
1013

1114
// eslint-disable-next-line import/no-extraneous-dependencies
1215
import 'katex/dist/katex.min.css';
@@ -23,8 +26,10 @@ export default function SpecificationComponent({
2326
remarkFrontmatter,
2427
remarkParse,
2528
[remarkGfm, { singleTilde: false }],
29+
remarkBreaks,
2630
]}
27-
rehypePlugins={[rehypeKatex, rehypeStringify]}
31+
rehypePlugins={[rehypeKatex, rehypeStringify, rehypeRaw]}
32+
className={style.container}
2833
>
2934
{bodyText}
3035
</ReactMarkdown>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@import "~styles/mixins";
2+
3+
.container {
4+
:global {
5+
table {
6+
display: block;
7+
width: 100%;
8+
overflow: auto;
9+
box-sizing: border-box;
10+
11+
* {
12+
box-sizing: border-box;
13+
}
14+
15+
tr {
16+
background-color: #fff;
17+
border-top: 1px solid #c6cbd1;
18+
}
19+
20+
th,
21+
td {
22+
padding: 6px 13px;
23+
border: 1px solid #dfe2e5;
24+
}
25+
}
26+
}
27+
}

src/shared/components/challenge-detail/Specification/styles.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,10 @@ $tc-link-visited: #0c4e98;
169169

170170
li::before {
171171
display: table-cell;
172-
font-weight: 700;
173172
text-align: right;
174173
content: counter(item) ".";
175174
padding: 0 10px 0 0;
175+
white-space: nowrap;
176176
}
177177
}
178178

@@ -352,10 +352,10 @@ $tc-link-visited: #0c4e98;
352352

353353
&::before {
354354
display: table-cell;
355-
font-weight: 700;
356355
text-align: right;
357356
content: counter(item) ".";
358357
padding: 0 10px 0 0;
358+
white-space: nowrap;
359359
}
360360
}
361361
}

0 commit comments

Comments
 (0)