Skip to content

Commit

Permalink
Merge branch 'master' into experimentalTagFiltering-naturalcrit#3164
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Ambatte committed Dec 5, 2023
2 parents 75809a5 + e99aad1 commit d8524c3
Show file tree
Hide file tree
Showing 11 changed files with 421 additions and 384 deletions.
349 changes: 154 additions & 195 deletions client/homebrew/brewRenderer/brewRenderer.jsx

Large diffs are not rendered by default.

30 changes: 14 additions & 16 deletions client/homebrew/brewRenderer/brewRenderer.less
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
@import (multiple, less) 'shared/naturalcrit/styles/reset.less';

.brewRenderer{
.brewRenderer {
will-change : transform;
overflow-y : scroll;
.pages{
.pages {
margin : 30px 0px;
&>.page{
& > .page {
width : 215.9mm;
height : 279.4mm;
margin-right : auto;
margin-bottom : 30px;
margin-left : auto;
box-shadow : 1px 4px 14px #000;
box-shadow : 1px 4px 14px #000000;
}
}
}
.pane{
position : relative;
}
.pageInfo{
.pane { position : relative; }
.pageInfo {
position : absolute;
right : 17px;
bottom : 0;
z-index : 1000;
background-color : #333;
font-size : 10px;
font-weight : 800;
color : white;
background-color : #333333;
div {
display: inline-block;
display : inline-block;
padding : 8px 10px;
&:not(:last-child){
border-right: 1px solid #666;
}
&:not(:last-child) { border-right : 1px solid #666666; }
}
}
.ppr_msg{
.ppr_msg {
position : absolute;
left : 0px;
bottom : 0;
left : 0px;
z-index : 1000;
padding : 8px 10px;
background-color : #333;
font-size : 10px;
font-weight : 800;
color : white;
background-color : #333333;
}
18 changes: 18 additions & 0 deletions client/homebrew/editor/editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,24 @@ const Editor = createClass({
}
}

// Superscript
if(line.includes('\^')) {
const regex = /\^(?!\s)(?=([^\n\^]*[^\s\^]))\1\^/g;
let match;
while ((match = regex.exec(line)) != null) {
codeMirror.markText({ line: lineNumber, ch: line.indexOf(match[1]) - 1 }, { line: lineNumber, ch: line.indexOf(match[1]) + match[1].length + 1 }, { className: 'superscript' });
}
}

// Subscript
if(line.includes('^^')) {
const regex = /\^\^(?!\s)(?=([^\n\^]*[^\s\^]))\1\^\^/g;
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: 'subscript' });
}
}

// Highlight injectors {style}
if(line.includes('{') && line.includes('}')){
const regex = /(?:^|[^{\n])({(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\2})/gm;
Expand Down
12 changes: 12 additions & 0 deletions client/homebrew/editor/editor.less
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@
font-weight : bold;
color : green;
}
.superscript:not(.cm-comment) {
font-weight : bold;
color : goldenrod;
vertical-align : super;
font-size : 0.9em;
}
.subscript:not(.cm-comment) {
font-weight : bold;
color : rgb(123, 123, 15);
vertical-align : sub;
font-size : 0.9em;
}
}

.brewJump {
Expand Down
Loading

0 comments on commit d8524c3

Please sign in to comment.