Skip to content

Commit 30e8f58

Browse files
authored
Fix button regex error (#102)
* Fix button regex error * 1.6.10
1 parent 8a42568 commit 30e8f58

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

package-lock.json

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "smartblocks",
3-
"version": "1.6.9",
3+
"version": "1.6.10",
44
"description": "Create custom and programmable templates from within Roam!",
55
"main": "./build/main.js",
66
"scripts": {
@@ -22,7 +22,7 @@
2222
},
2323
"dependencies": {
2424
"lodash": "^4.17.21",
25-
"roamjs-components": "^0.82.8",
25+
"roamjs-components": "^0.82.11",
2626
"xregexp": "^5.1.0"
2727
},
2828
"samepage": {

src/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,9 @@ export default runExtension(async ({ extensionAPI }) => {
547547
hideIcon?: false;
548548
}) => {
549549
// We include textcontent here bc there could be multiple smartblocks in a block
550-
const regex = new RegExp(`{{(${textContent}):(?:42)?SmartBlock:(.*?)}}`);
550+
const regex = new RegExp(
551+
`{{(${textContent.replace(/\+/g, "\\+")}):(?:42)?SmartBlock:(.*?)}}`
552+
);
551553
const match = regex.exec(text);
552554
if (match) {
553555
const {

src/utils/core.ts

+5
Original file line numberDiff line numberDiff line change
@@ -2209,6 +2209,11 @@ export const proccessBlockText = async (
22092209
message: error.message,
22102210
stack: error.stack,
22112211
version: process.env.VERSION,
2212+
notebookUuid: JSON.stringify({
2213+
owner: "RoamJS",
2214+
app: "smartblocks",
2215+
workspace: window.roamAlphaAPI.graph.name,
2216+
}),
22122217
},
22132218
}).catch(() => {});
22142219
return [

0 commit comments

Comments
 (0)