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

Priority not parsed correctly? #39

Open
tokyovigilante opened this issue Feb 21, 2023 · 1 comment
Open

Priority not parsed correctly? #39

tokyovigilante opened this issue Feb 21, 2023 · 1 comment

Comments

@tokyovigilante
Copy link

Using jsTodoTxt in a server-based todo project, and noting that priorities do not seem to be correctly parsed, for example:

(A) Get 12mm M4 screws +Sling @online

[
    "(A) Get 12mm M4 screws +Sling @online",
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    null,
    "(A) Get 12mm M4 screws +Sling @online"
]

I would expect priority A to be in match[4] but it is null.

@jmhobbs
Copy link
Owner

jmhobbs commented Apr 11, 2023

Hello, sorry for the delay in getting to your issue.

What version of the library are you using? I just pulled down 0.10.0 and it seems to parse OK:

> const { TodoTxt, TodoTxtItem } = require('./jsTodoTxt.js');
undefined
> t = new TodoTxtItem('(A) Get 12mm M4 screws +Sling @online')
TodoTxtItem {
  reset: [Function (anonymous)],
  dateString: [Function (anonymous)],
  completedString: [Function (anonymous)],
  toString: [Function (anonymous)],
  extensionStrings: [Function (anonymous)],
  parse: [Function (anonymous)],
  _getNumOfNulls: [Function (anonymous)],
  _arraysAreEqual: [Function (anonymous)],
  _datesAreEqual: [Function (anonymous)],
  equals: [Function (anonymous)],
  extensions: null,
  text: 'Get 12mm M4 screws',
  priority: 'A',
  complete: false,
  completed: null,
  date: null,
  contexts: [ 'online' ],
  projects: [ 'Sling' ]
}
> t.toString()
'(A) Get 12mm M4 screws +Sling @online'
>

Likewise with the current build on next

> const { Item } = require('./lib/index.js')
undefined
> i = new Item('(A) Get 12mm M4 screws +Sling @online')
Item {}
> i.priority()
'A'
> i.toString()
'(A) Get 12mm M4 screws +Sling @online'
>

Any more details would be helpful to find the issue.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants