Fsnotes: Inline tagging system picking up extraneous data

Created on 31 Oct 2019  路  9Comments  路  Source: glushchenko/fsnotes

Describe the bug
I have Ruby code enclosed in code tags but because I have #{one} within a String in the Ruby code, a new tag is created for {one}. Is it possible to not scan code samples for tags?

To Reproduce
Steps to reproduce the behavior:

  1. Create a new note
  2. Create a code block using three backticks and specify the language as Ruby, for example

watermelon = 'code'
"Here's some ruby #{watermelon}"
  1. Notice that a new tag with name {watermelon} is created

Expected behavior
Scanning for inline tags should respect some boundaries for Markdown text especially code samples that are clearly defined

Actual behavior
Scanning for inline tags does not respect code boundaries so a lot of useless tags get created

Workaround
Disable scanning for inline tags

Supporting Files
Screen Shot 2019-10-31 at 2 13 10 PM
Screen Shot 2019-10-31 at 2 13 24 PM

Desktop (please complete the following information):

  • OS: macOS
  • OS version: 10.14.6
  • FSNotes version: 4.0.2

Additional context

bug request

Most helpful comment

Numbers and hex will be excluded from 4.0.7, code blocks I think a little bit later.

All 9 comments

You can add #notags tag for disable tags

Thanks for the quick turnaround! If I do that, I do not get tags at all. I do want to be able to tag notes, but I also want to be able to have code samples in there. It seems that the scanning of inline tags doesn't support both.

You proposal is code blocks checking in tags scanner?

I would say yes.

`This #{var} should not become a tag`

and


This #{var} should not become a tag either

Apparently, it affects Latex blocks as well. So

$ a \dot b #some_random_thing $

should not become a tag and

$$
This #var should not show up as a tag either
$$

I notice that it seems FSNotes doesn't support <pre> blocks. On GitHub, if I want to write the literal three back-tick characters without starting a code block (like I've been doing in this issue post), I can surround the text with <pre></pre> and it will come out unmodified. The point is, if FSNotes ever starts supporting that or if it supports some other way, then we'd need to make sure that we don't search those fenced blocks for tags as well.

Hi @glushchenko great app, thanks for your work.

I just filed #733 which I just realized is somewhat a dupe of this bug.

My suggestion there is to treat a valid tag as a # followed by at least one letter, preferably something like this regex: /#[a-zA-Z][a-zA-Z0-9\-]+/

Right now I have tons of accidental tags for my imported notes. In my case I have many notes which contain misc log output statements, bash, or ruby...

Yeah, I have a lot of notes with hex colors (like #FF0000) and I would prefer if they were not picked up.

Numbers and hex will be excluded from 4.0.7, code blocks I think a little bit later.

I'm afraid I might add another level of complexity, but I'll ask anyway. I use Slack extensively and many of my notes refer to Slack channels, which all start with a # (e.g. the main #announcements channel).

Would it be possible to have a "not a tag" option to exclude specific strings from being marked as tags?

Add #notags in note

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gmenzel picture gmenzel  路  3Comments

shurain picture shurain  路  3Comments

sloria picture sloria  路  3Comments

jakemkc picture jakemkc  路  4Comments

peanutputter picture peanutputter  路  4Comments