diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 05eda75b..b87b267e 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -12,10 +12,6 @@ body: description: The best feature requests provide an explanation of the current issue and then an explanation of how it could be improved. Screenshots/images can be pasted right in as well! validations: required: true - - type: checkboxes - id: terms + - type: markdown attributes: - label: "Please confirm:" - options: - - label: I have searched the Issues tracker for any duplicate requests and found none. - required: true \ No newline at end of file + value: "Please be sure to search for any close matches to your request in the GitHub Issues tracker before opening a new request, thanks!" diff --git a/.github/ISSUE_TEMPLATE/general_issue.yml b/.github/ISSUE_TEMPLATE/general_issue.yml index 33dd5b2b..18c19254 100644 --- a/.github/ISSUE_TEMPLATE/general_issue.yml +++ b/.github/ISSUE_TEMPLATE/general_issue.yml @@ -4,14 +4,15 @@ body: - type: markdown attributes: value: Please include as much information as possible. - - type: checkboxes + - type: dropdown id: renderer attributes: label: Renderer description: Which renderer does this issue occur on? If you are unsure, you can check the renderer in the Properties Editor (click the "i" in the Snippet Menu bar above the editor). options: - - label: Legacy - - label: v3 + - v3 + - Legacy + - Both validations: required: true - type: dropdown diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 947ae7b7..698a4bb7 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -157,7 +157,7 @@ const Editor = createClass({ } // Highlight inline spans {{content}} if(line.includes('{{') && line.includes('}}')){ - const regex = /{{(?:(?=(:(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*))\1)*|}}/g; + const regex = /{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *|}}/g; let match; let blockCount = 0; while ((match = regex.exec(line)) != null) { @@ -176,7 +176,7 @@ const Editor = createClass({ // Highlight block divs {{\n Content \n}} let endCh = line.length+1; - const match = line.match(/^ *{{(?:(?=(:(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*))\1)* *$|^ *}}$/); + const match = line.match(/^ *{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *$|^ *}}$/); if(match) endCh = match.index+match[0].length; codeMirror.markText({ line: lineNumber, ch: 0 }, { line: lineNumber, ch: endCh }, { className: 'block' }); diff --git a/client/homebrew/navbar/navbar.less b/client/homebrew/navbar/navbar.less index 5f37d74a..3bd6a66e 100644 --- a/client/homebrew/navbar/navbar.less +++ b/client/homebrew/navbar/navbar.less @@ -115,8 +115,36 @@ color : white; text-decoration : none; border-top : 1px solid #888; + overflow : clip; + .clear{ + display : none; + position : absolute; + top : 50%; + transform : translateY(-50%); + right : 0px; + width : 20px; + height : 100%; + background-color : #333; + opacity : 70%; + border-radius : 3px; + &:hover { + opacity : 100%; + } + i { + text-align : center; + font-size : 10px; + margin : 0; + height :100%; + width :100%; + } + } &:hover{ background-color : @blue; + + .clear{ + display : grid; + place-content : center; + } } .title{ display : inline-block; diff --git a/client/homebrew/navbar/recent.navitem.jsx b/client/homebrew/navbar/recent.navitem.jsx index ee24cfd5..169c46a0 100644 --- a/client/homebrew/navbar/recent.navitem.jsx +++ b/client/homebrew/navbar/recent.navitem.jsx @@ -119,6 +119,25 @@ const RecentItems = createClass({ }); }, + removeItem : function(url, evt){ + evt.preventDefault(); + + let edited = JSON.parse(localStorage.getItem(EDIT_KEY) || '[]'); + let viewed = JSON.parse(localStorage.getItem(VIEW_KEY) || '[]'); + + edited = edited.filter((item)=>{ return (item.url !== url);}); + viewed = viewed.filter((item)=>{ return (item.url !== url);}); + + localStorage.setItem(EDIT_KEY, JSON.stringify(edited)); + localStorage.setItem(VIEW_KEY, JSON.stringify(viewed)); + + this.setState({ + edit : edited, + view : viewed + }); + + }, + renderDropdown : function(){ if(!this.state.showDropdown) return null; @@ -127,6 +146,7 @@ const RecentItems = createClass({ return {brew.title || '[ no title ]'} {Moment(brew.ts).fromNow()} +
{this.removeItem(`${brew.url}`, e);}}>
; }); }; diff --git a/client/template.js b/client/template.js index 13e09711..cab4790b 100644 --- a/client/template.js +++ b/client/template.js @@ -1,6 +1,7 @@ const template = async function(name, title='', props = {}){ const ogTags = []; - Object.entries(props.ogMeta).forEach(([key, value])=>{ + const ogMeta = props.ogMeta ?? {}; + Object.entries(ogMeta).forEach(([key, value])=>{ if(!value) return; const tag = ``; ogTags.push(tag); diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 3c52e514..8dbb1d7f 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -32,7 +32,7 @@ const mustacheSpans = { start(src) { return src.match(/{{[^{]/)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const completeSpan = /^{{[^\n]*}}/; // Regex for the complete token - const inlineRegex = /{{(?:(?=(:(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*))\1)* *|}}/g; + const inlineRegex = /{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *|}}/g; const match = completeSpan.exec(src); if(match) { //Find closing delimiter @@ -82,7 +82,7 @@ const mustacheDivs = { start(src) { return src.match(/\n *{{[^{]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const completeBlock = /^ *{{[^\n}]* *\n.*\n *}}/s; // Regex for the complete token - const blockRegex = /^ *{{(?:(?=(:(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*))\1)* *$|^ *}}$/gm; + const blockRegex = /^ *{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *$|^ *}}$/gm; const match = completeBlock.exec(src); if(match) { //Find closing delimiter @@ -130,7 +130,7 @@ const mustacheInjectInline = { level : 'inline', start(src) { return src.match(/ *{[^{\n]/)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const inlineRegex = /{(?:(?=(:(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*))\1)*}/g; + const inlineRegex = /^ *{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1}/g; const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1]; @@ -165,7 +165,7 @@ const mustacheInjectBlock = { level : 'block', start(src) { return src.match(/\n *{[^{\n]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const inlineRegex = /{(?:(?=(:(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*))\1)*}/ym; + const inlineRegex = /^ *{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1}/ym; const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1];