🐛 Fix iphone 13 unable to use regex lookbehinds (#3823)

* fix iphone 13 unable to use regex lookbehinds

* release notes
This commit is contained in:
Michael Clark
2024-11-12 08:58:01 +00:00
committed by GitHub
parent 2cb668a40c
commit dd69e539d3
2 changed files with 19 additions and 3 deletions

View File

@@ -462,9 +462,19 @@ export function conditionsToAQL(conditions, { recurDateBounds = 100 } = {}) {
return { $or: values.map(v => apply(field, '$eq', v)) };
case 'hasTags':
const tagValues = value
.split(/(?<!#)(#[\w\d\p{Emoji}-]+)(?=\s|$)/gu)
.filter(tag => tag.startsWith('#'));
const words = value.split(/\s+/);
const tagValues = [];
words.forEach(word => {
const startsWithHash = word.startsWith('#');
const containsMultipleHash = word.slice(1).includes('#');
const correctlyFormatted = word.match(/#[\w\d\p{Emoji}-]+/gu);
const validHashtag =
startsWithHash && !containsMultipleHash && correctlyFormatted;
if (validHashtag) {
tagValues.push(word);
}
});
return {
$and: tagValues.map(v => {

View File

@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [MikesGlitch]
---
Fix Iphone 13 error when attempting to view budget.