memos
memos copied to clipboard
Restrict tag creation in the body of a note
Is your feature request related to a problem?
I'm a programmer and often have notes with code fragments in them. Unfortunately when the language uses a # for something like a comment, this triggers the definition of a tag in memos. (If the comment is well formatted with a space, this doesn't happen.)
For example: export foo=bar #do something silly
"do" is now a tag
Describe the solution you'd like
Perhaps restrict tag definitions to the last two lines of a note? (two so it will accommodate an extra carriage return on the note)?
An alternative would be to create a separate text entry box for tags? But that would clutter the UI.
Additional context
No response
Addition: I'm not too sure how codeblocks are handled, but perhaps just don't create any tags if they're inside of a codeblock? Looks like they're just Markdown codeblocks, starting with 3 ` and ending with 3 `. Perhaps just ignore that entire part of a memo's content when looking for tags?
Just tested this, and it already does what I said above. Looks like your solution could be using codeblocks.
Great suggestion but it didn't solve the issue for me. (I do like the look of code blocks!) (There's another known issue that you need a space character after a tag definition to make it work. My example made sure I had the space. Did yours? This still gets a tag called "do":
export foo=bar #do stuff
Yep, I tried both with and without space after the 'tag'. No tag was created for me. Even copying your exact code still doesn't reproduce the issue. Perhaps someone else can reproduce it?
The issue is tags being created inadvertently by memos. I can follow all the best practices but when I paste a code fragment into memos, I still tags created that I don't want.
@nwscfox Add a space between # and comment content?
Right, but if you're just quickly making a memo with some code, you don't want to have to look over the whole code to see if there's any comment without a space.
The best practice for c code is to not have use spaces between the # and the text of a preprocessor definitions (I've seen it used for indented code but only rarely). Thus this is preferred: #include <stdio.h> #define foo bar Over the following:
include <stdio.h>
define foo bar
Although my example used the # as a comment character, my description warned of any use of the # character in any programming language. Try color definitions in HTML; #32a852 is a lovely shade of green but will trigger the tag finder in memos so now I have a tag labeled 32a852.