-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add test for weird side-case #31
Conversation
Ran into this on a real Notion page; it's weird, but Notion let's you include bolded spaces. For some reason, this is causing our current rich text handling to crash.
Also improve the log messages in the case that an invalid AST is sent over to pandoc.
In particular, make it possible for plugins to set the relative directory where images are stored.
`notion_data` is now used everywhere for the raw data passed in from the notion API responses.
Move the plugin system over onto the Client class; allow users to use multiple plugins. All notion classes can now be swapped out.
It's annoying to have to re-run with higher logging levels if something fails.
This assumes that these won't take up so much space that RAM will be an issue. This problem seems a long way away. Once we get there we will need to use a sqlite database to handle the cache.
Note that we could probably use the MentionRichText.plain_text value to get the page title, instead of querying the page, but we'll want to query the page soon enough in order to support linking, thus it's probablly worth it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plugin system looks much more robust now. Good progress. Nothing major stood out. Just some regex improvements in the new builtin plugins. Also there are some flake8 errors.
result = self.rich_text.matches(self.trigger_regex) | ||
if result: | ||
number_of_equal_signs = len(result.group(1)) | ||
self.level += number_of_equal_signs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when the level is >6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question; as best I can tell, Pandoc's markdown accepts any level of headers (note HTML doesn't as far as I know, but the markdown to html stuff is kind of scope).
Co-authored-by: Ilya Spivakov <xaker00@gmail.com>
There is still a mysterious space placed between the language and the ```, which causes problems.
Fix a bug with the divider block (due to utils.pandoc_ast_to_markdown Add a test case for a bug if you have an empty todo block
Was running into issues with spaces, colons, and slashes
Also connect blocks the their page, which will be useful for all sorts of things.
If we let it through, it will confuse users
Improve filename sanitization
This is more efficient and it avoids circular references.
@xaker00 here's another small PR. See the release notes for some context. It would probably be easiest to review this commit-by-commit.