Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text containing only tagsymbols should not be treated as tags #1700

Open
micahellison opened this issue Mar 8, 2023 · 1 comment
Open

Text containing only tagsymbols should not be treated as tags #1700

micahellison opened this issue Mar 8, 2023 · 1 comment
Labels
bug Something isn't working 📌 This can't go stale
Milestone

Comments

@micahellison
Copy link
Member

Diagnostic output

jrnl: v3.3
Python: 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)]
OS: Windows 10

Current Behavior

With the default tagsymbols # and @, it's easy to enter text that isn't meant to be a tag but is still registered as one. For instance, a markdown heading starting with ### adds ### as a tag.

It is doing it in some cases, but it's strangely inconsistent.

Expected Behavior

When running jrnl --tags, no text should be treated as a tag if it's composed entirely of tagsymbols.

Repro Steps

I ensure my tagsymbols are set to the default #@.

I create a new journal entry with the following:

@@
##
@#@
#@#
#@#@#
@#@#@
###
@@@
####

I run jrnl --tags:

@#                   : 1
####                 : 1
###                  : 1
##                   : 1

None of those should appear as tags.

Debug output

DEBUG    root         Parsed args: Namespace(debug=True, preconfig_cmd=None, postconfig_cmd=None, filename=None, on_date=None, today_in_history=False, month=None, day=None, year=None, start_date=None, end_date=None, contains=None, strict=False, starred=False, limit=None, excluded=[], edit=False, delete=False, change_time=None, export=False, tags=True, short=False, config_override=[], config_file_path='', text=[])
DEBUG    root         Reading configuration from file C:\Users\micah\.config\jrnl\jrnl.yaml
DEBUG    root         Using configuration "{'colors': {'body': 'none', 'date': 'black', 'tags': 'yellow', 'title': 'cyan'}, 'default_hour': 9, 'default_minute': 0, 'display_format': None, 'editor': 'subl -w', 'encrypt': False, 'highlight': True, 'indent_character': '| ', 'journals': {***********}, 'linewrap': 80, 'tagsymbols': '#@', 'template': False, 'timeformat': '%F %r', 'version': 'v3.3'}"
DEBUG    root         Using journal name: default
DEBUG    root         Updating configuration with specific journal overrides {'encrypt': False, 'journal': 'C:\\Users\\micah\\Documents\\jrnl\\default.txt'}
DEBUG    root         opened PlainJournal with 1 entries
@#                   : 1
####                 : 1
###                  : 1
##                   : 1

Other Information

It's important that this only applies to tokens that are entirely composed of tagsymbols. I think a tag like #abc#def should still be read as one tag, even though it contains the tag symbol twice.

@micahellison micahellison added bug Something isn't working 🆕 New! labels Mar 8, 2023
@micahellison micahellison added 📌 This can't go stale and removed 🆕 New! labels Mar 18, 2023
@micahellison
Copy link
Member Author

A solution to this should also ensure that tags are colored correctly with the same logic.

@micahellison micahellison added this to the Backlog milestone Jul 29, 2023
comkieffer added a commit to comkieffer/jrnl that referenced this issue Mar 24, 2024
Text made up only of tagsymbols should not be treated as a tag.

Closes jrnl-org#1700
comkieffer added a commit to comkieffer/jrnl that referenced this issue Mar 24, 2024
Text made up only of tagsymbols should not be treated as a tag.

Closes jrnl-org#1700
comkieffer added a commit to comkieffer/jrnl that referenced this issue May 25, 2024
Text made up only of tagsymbols should not be treated as a tag.

Closes jrnl-org#1700
comkieffer added a commit to comkieffer/jrnl that referenced this issue May 25, 2024
Text made up only of tagsymbols should not be treated as a tag.

Closes jrnl-org#1700
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📌 This can't go stale
Projects
None yet
Development

No branches or pull requests

1 participant