From 68c0f210ccb76a2c12e58120a68d64b9278a663c Mon Sep 17 00:00:00 2001 From: bimlas Date: Sat, 7 Apr 2018 15:43:06 +0200 Subject: [PATCH] Separate active tags by ` ` instead of `&` Using `&` to separate tags in path (like `/tags/currently&selected&tags`) may interfer with tags including `&` character (like `black&white`). Since ` ` is replaced with `_` when adding tag to notes, it's ideal separator because it's guaranteed that tags are not including this character. --- browser/main/NoteList/index.js | 2 +- browser/main/SideNav/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index 867457ca..def289fb 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -343,7 +343,7 @@ class NoteList extends React.Component { } if (location.pathname.match(/\/tags/)) { - const listOfTags = params.tagname.split('&') + const listOfTags = params.tagname.split(' ') return data.noteMap.map(note => { return note }).filter(note => { diff --git a/browser/main/SideNav/index.js b/browser/main/SideNav/index.js index a9f9f0da..b4c1d322 100644 --- a/browser/main/SideNav/index.js +++ b/browser/main/SideNav/index.js @@ -196,7 +196,7 @@ class SideNav extends React.Component { if (tags === 'alltags') { return [] } - return tags.split('&') + return tags.split(' ') } handleClickTagListItem (name) { @@ -229,7 +229,7 @@ class SideNav extends React.Component { } else { listOfTags.push(name) } - router.push(`/tags/${listOfTags.join('&')}`) + router.push(`/tags/${listOfTags.join(' ')}`) } emptyTrash (entries) {