mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-27 20:12:40 +00:00
Near complete
This commit is contained in:
@@ -160,6 +160,24 @@ const Editor = createClass({
|
||||
}
|
||||
}
|
||||
|
||||
// Superscript
|
||||
if(line.includes('^^') && !line.includes('^^^')) {
|
||||
const regex = /.*\^\^(.+)\^\^/y;
|
||||
let match;
|
||||
while ((match = regex.exec(line)) != null) {
|
||||
codeMirror.markText({ line: lineNumber, ch: line.indexOf(match[1]) - 2 }, { line: lineNumber, ch: line.indexOf(match[1]) + match[1].length + 2 }, { className: 'superscript' });
|
||||
}
|
||||
}
|
||||
|
||||
// Subscript
|
||||
if(line.includes('^^^')) {
|
||||
const regex = /.*\^\^\^(.+)\^\^\^/y;
|
||||
let match;
|
||||
while ((match = regex.exec(line)) != null) {
|
||||
codeMirror.markText({ line: lineNumber, ch: line.indexOf(match[1]) - 3 }, { line: lineNumber, ch: line.indexOf(match[1]) + match[1].length + 3 }, { className: 'subscript' });
|
||||
}
|
||||
}
|
||||
|
||||
// Highlight injectors {style}
|
||||
if(line.includes('{') && line.includes('}')){
|
||||
const regex = /(?:^|[^{\n])({(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\2})/gm;
|
||||
|
||||
@@ -43,6 +43,14 @@
|
||||
font-weight : bold;
|
||||
color : green;
|
||||
}
|
||||
.superscript:not(.cm-comment) {
|
||||
font-weight : bold;
|
||||
color : goldenrod;
|
||||
}
|
||||
.subscript:not(.cm-comment) {
|
||||
font-weight : bold;
|
||||
color : rgb(123, 123, 15);
|
||||
}
|
||||
}
|
||||
|
||||
.brewJump {
|
||||
|
||||
Reference in New Issue
Block a user