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

Problem with md_text string #14

Open
denostr opened this issue Jan 27, 2022 · 1 comment
Open

Problem with md_text string #14

denostr opened this issue Jan 27, 2022 · 1 comment

Comments

@denostr
Copy link

denostr commented Jan 27, 2022

Running markdown-toc from example, with note name or with UUID, result the same.

Python 3.9.10

$ markdown-toc -h 3 -t bear "D59BF56B-A152-46A8-A513-B043C1BD6BEC-3815-00000012FB42BD77"
Traceback (most recent call last):
  File "/opt/homebrew/bin/markdown-toc", line 4, in <module>
    markdowntoc.main()
  File "/opt/homebrew/lib/python3.9/site-packages/markdowntoc/markdowntoc.py", line 295, in main
    md_text_toc_pairs, identifiers = create_table_of_contents_bear()
  File "/opt/homebrew/lib/python3.9/site-packages/markdowntoc/markdowntoc.py", line 199, in create_table_of_contents_bear
    notes = get_notes_from_bear()
  File "/opt/homebrew/lib/python3.9/site-packages/markdowntoc/markdowntoc.py", line 64, in get_notes_from_bear
    return list(filter(lambda note: match_title_uuid_tag(note), notes))
  File "/opt/homebrew/lib/python3.9/site-packages/markdowntoc/markdowntoc.py", line 64, in <lambda>
    return list(filter(lambda note: match_title_uuid_tag(note), notes))
  File "/opt/homebrew/lib/python3.9/site-packages/markdowntoc/markdowntoc.py", line 58, in match_title_uuid_tag
    note_tags = get_tags_in_note(note['ZTEXT'])
  File "/opt/homebrew/lib/python3.9/site-packages/markdowntoc/markdowntoc.py", line 75, in get_tags_in_note
    lines_iter = iter(md_text.splitlines())
AttributeError: 'NoneType' object has no attribute 'splitlines'
@Din0-3
Copy link

Din0-3 commented Sep 9, 2022

got same results after locking a note with password. I've disabled password locked notes and the script started working again, guess there's some global change to the note retrieval when some notes where locked by pw.

from the error message itself it can be Implied that the program cannot fetch the markdown text properly, so it returns nothing, rather than the note. Thus no TOC can be generated from nothing.

hope that helps

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