Closed prurph closed 4 years ago
Wow this is great! I sincerely appreciate the work, and I do agree that having it be able to parse code fences with no explicit language is beneficial. Thanks for adding that feature and test.
The only thing I would change is that there's a recently added, currently undocumented feature in notion-py
that would be a better handle for this, title_plaintext
.
If you change title
in the dict to title_plaintext
, it should allow us to pass in the code text and language without having to make it a codefence + language and get reparsed + run into another sort of fuck up in the process.
Looks good, thanks!
Awesome library! I seem to be having a small issue with code blocks and indentation:
Expected: code block is created on page with
print("World!")
indented. Actual: code block is created on page withprint("World!")
(no ident) instead.I did some very brief poking at
notion-py
and it seems to be that we're passing this as aCodeBlock
which is translated (inherits fromBasicBlock
) as markdown by default, but since we've already stripped out the markdown portion, it looks like the parsing strips out the leading whitespace.I'm not sure if perhaps this is an issue for
notion-py
, but here's a quick stab at a fix in this library.