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

Empty embed links are unhandled #536

Closed
Programmerino opened this issue Jan 9, 2023 · 1 comment
Closed

Empty embed links are unhandled #536

Programmerino opened this issue Jan 9, 2023 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@Programmerino
Copy link
Contributor

The latest commit (94415cd) seems to have made empty embed links (e.g. ![[]]) crash the program:

> COMPILING MARKDOWN FROM OBSIDIAN CODE (/tmp/tmp7mhc5ct6/file.md)
Traceback (most recent call last):
  File "/nix/store/yrx2yl0r4zbhapqbnwb5y98mlbgk678g-obsidianhtml-3.3.1/lib/python3.10/site-packages/obsidianhtml/core/ErrorHandling.py", line 60, in _decorator
    res = f(*args, **kwargs)
  File "/nix/store/yrx2yl0r4zbhapqbnwb5y98mlbgk678g-obsidianhtml-3.3.1/lib/python3.10/site-packages/obsidianhtml/controller/ConvertVault.py", line 526, in crawl_obsidian_notes_and_convert_to_markdown
    md.ConvertObsidianPageToMarkdownPage()
  File "/nix/store/yrx2yl0r4zbhapqbnwb5y98mlbgk678g-obsidianhtml-3.3.1/lib/python3.10/site-packages/obsidianhtml/parser/MarkdownPage.py", line 466, in ConvertObsidianPageToMarkdownPage
    result = GetObsidianFilePath(link, self.file_tree, self.pb)
  File "/nix/store/yrx2yl0r4zbhapqbnwb5y98mlbgk678g-obsidianhtml-3.3.1/lib/python3.10/site-packages/obsidianhtml/core/FileFinder.py", line 24, in GetObsidianFilePath
    output['rtr_path_str'], output['fo'] = FindFile(file_tree, link, pb)
  File "/nix/store/yrx2yl0r4zbhapqbnwb5y98mlbgk678g-obsidianhtml-3.3.1/lib/python3.10/site-packages/obsidianhtml/core/FileFinder.py", line 41, in FindFile
    if link[0] == '/':
IndexError: string index out of range

	OBS.HTML EXTRA ERROR INFORMATION:
	---------------------------------
	Current action              : Conversion of Obsidian notes to proper Markdown notes
	Subroutine                  : crawl_obsidian_notes_and_convert_to_markdown
	Current note being processed: /tmp/tmp7mhc5ct6/file.md (/tmp/test/test/file.md)

file.md just contains ![[]]

@dwrolvink dwrolvink added the bug Something isn't working label Jan 13, 2023
@dwrolvink dwrolvink added this to the v3.3.0+ milestone Jan 13, 2023
@dwrolvink
Copy link
Collaborator

Should be fixed by this change. Let me know if there are still issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants