Skip to content

Commit 31765a9

Browse files
committed
Make message more verbose & tweak style
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
1 parent 2852be0 commit 31765a9

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

public/js/lib/editor/markdown-lint/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import markdownlint from 'markdownlint'
22

3-
// load lint plugin explicitly
3+
// load CM lint plugin explicitly
44
import 'script-loader!@hackmd/codemirror/addon/lint/lint'
55
import './lint.css'
66

@@ -21,7 +21,7 @@ import './lint.css'
2121
}
2222

2323
return {
24-
message: error.ruleDescription,
24+
messageHTML: `${error.ruleNames.join('/')}: ${error.ruleDescription}`,
2525
severity: 'error',
2626
from: CodeMirror.Pos(lineNumber, start),
2727
to: CodeMirror.Pos(lineNumber, end)

public/js/lib/editor/markdown-lint/lint.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
}
55

66
.CodeMirror-lint-tooltip {
7-
background-color: #ffd;
8-
border: 1px solid black;
9-
border-radius: 4px 4px 4px 4px;
10-
color: black;
11-
font-family: monospace;
7+
background-color: #333333;
8+
border: 1px solid #eeeeee;
9+
border-radius: 4px;
10+
color: white;
11+
font-family: "Source Code Pro", Consolas, monaco, monospace;
1212
font-size: 10pt;
1313
overflow: hidden;
1414
padding: 2px 5px;
@@ -32,7 +32,6 @@
3232

3333
.CodeMirror-lint-mark-error {
3434
background-image: url(/images/lint/mark-error.png);
35-
;
3635
}
3736

3837
.CodeMirror-lint-mark-warning {
@@ -52,9 +51,10 @@
5251
}
5352

5453
.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning {
55-
padding-left: 18px;
54+
padding-left: 20px;
5655
background-position: top left;
5756
background-repeat: no-repeat;
57+
background-position-y: 2px;
5858
}
5959

6060
.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {

0 commit comments

Comments
 (0)