Skip to content

Commit

Permalink
Fix button regex error (#102)
Browse files Browse the repository at this point in the history
* Fix button regex error

* 1.6.10
  • Loading branch information
dvargas92495 authored Oct 10, 2023
1 parent 8a42568 commit 30e8f58
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smartblocks",
"version": "1.6.9",
"version": "1.6.10",
"description": "Create custom and programmable templates from within Roam!",
"main": "./build/main.js",
"scripts": {
Expand All @@ -22,7 +22,7 @@
},
"dependencies": {
"lodash": "^4.17.21",
"roamjs-components": "^0.82.8",
"roamjs-components": "^0.82.11",
"xregexp": "^5.1.0"
},
"samepage": {
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,9 @@ export default runExtension(async ({ extensionAPI }) => {
hideIcon?: false;
}) => {
// We include textcontent here bc there could be multiple smartblocks in a block
const regex = new RegExp(`{{(${textContent}):(?:42)?SmartBlock:(.*?)}}`);
const regex = new RegExp(
`{{(${textContent.replace(/\+/g, "\\+")}):(?:42)?SmartBlock:(.*?)}}`
);
const match = regex.exec(text);
if (match) {
const {
Expand Down
5 changes: 5 additions & 0 deletions src/utils/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2209,6 +2209,11 @@ export const proccessBlockText = async (
message: error.message,
stack: error.stack,
version: process.env.VERSION,
notebookUuid: JSON.stringify({
owner: "RoamJS",
app: "smartblocks",
workspace: window.roamAlphaAPI.graph.name,
}),
},
}).catch(() => {});
return [
Expand Down

0 comments on commit 30e8f58

Please sign in to comment.