Skip to content

Build your personal knowledge base with Trilium Notes

fallback for missing parsed title, closes trilium-web-clipper/issues/16

zadam3219441fdfa1
diff --git a/src/routes/api/clipper.js b/src/routes/api/clipper.js
index 6ad2efea4b..f6917f00d0 100644
--- a/src/routes/api/clipper.js
+++ b/src/routes/api/clipper.js
@@ -65,7 +65,11 @@ async function addClipping(req) {
}
async function createNote(req) {
- const {title, content, pageUrl, images, clipType} = req.body;
+ let {title, content, pageUrl, images, clipType} = req.body;
+
+ if (!title || !title.trim()) {
+ title = "Clipped note from " + pageUrl;
+ }
log.info(`Creating clipped note from ${pageUrl}`);
@@ -155,4 +159,4 @@ module.exports = {
addClipping,
openNote,
handshake
-};
\ No newline at end of file
+};