feature (editor): syntax highlighting for .properties file

This commit is contained in:
Mickael KERJEAN
2018-11-21 22:30:01 +11:00
parent b0f4310d7d
commit cb4c98e871
5 changed files with 10 additions and 2 deletions
+1
View File
@@ -183,6 +183,7 @@ export class Editor extends React.Component {
else if(ext === 'latex' || ext === 'tex'){ mode = 'stex'; }
else if(ext === 'diff' || ext === 'patch'){ mode = 'diff'; }
else if(ext === 'sparql'){ mode = 'sparql'; }
else if(ext === 'properties'){ mode = 'properties'; }
else if(ext === 'c' || ext === 'cpp' || ext === 'java' || ext === 'h'){
mode = 'clike';
}else{
+3 -1
View File
@@ -178,9 +178,11 @@ pre.CodeMirror-line{clear: right;}
.cm-s-default .cm-strong{color: var(--secondary)}
.cm-s-default .cm-org-url, .cm-s-default .cm-org-image{color: var(--secondary)!important; border-bottom: 1px dashed var(--light); cursor: pointer;}
.cm-s-default .cm-variable-3 {color: #085;}
.cm-s-default .cm-comment {color: var(--secondary);}
.cm-s-default .cm-comment {color: var(--light);}
.cm-s-default .cm-string, .cm-s-default .cm-string-2{ color: #c41a16; }
.cm-s-default .cm-def { color: rgb(68, 85, 136); }
.cm-s-default .cm-quote { color: var(--dark); }
.CodeMirror-gutters{
box-shadow: 0px 0px 2px rgba(0,0,0,0.1);
@@ -0,0 +1,3 @@
import 'codemirror/mode/properties/properties';
CodeMirror.__mode = 'properties';
export default CodeMirror;
+2
View File
@@ -47,6 +47,7 @@
"html": "text/html",
"ico": "image/x-icon",
"img": "application/octet-stream",
"ini": "text/x-ini",
"iso": "application/octet-stream",
"jad": "text/vnd.sun.j2me.app-descriptor",
"jar": "application/java-archive",
@@ -101,6 +102,7 @@
"ppt": "application/vnd.ms-powerpoint",
"pptx": "application/powerpoint",
"prc": "application/x-pilot",
"properties": "text/x-ini",
"ps": "application/postscript",
"ra": "audio/x-realaudio",
"raf": "image/x-fuji-raf",
+1 -1
View File
@@ -33,7 +33,7 @@
"html-loader": "^0.4.5",
"html-webpack-plugin": "^2.28.0",
"jest": "^23.6.0",
"node-sass": "^4.7.2",
"node-sass": "^4.10.0",
"nodemon": "^1.17.1",
"prop-types": "^15.5.10",
"react": "^15.3.2",