Merge pull request #18 from candu/master

Support for Notion inline "alias" links
This commit is contained in:
Leonardo Cavaletti 2020-11-28 15:50:01 +00:00 committed by GitHub
commit d9d8009be7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -34,6 +34,12 @@ div[role="button"]:not(.notion-record-icon):hover {
padding-right: unset !important;
}
/* pull alias arrows back inline */
svg.alias {
display: inline-block !important;
height: auto !important;
}
@media only screen and (max-width: 960px) {
/* normalizes banner / page title width */
.notion-scroller > div:not([class]),

View File

@ -555,8 +555,10 @@ class Parser:
# find sub-pages and clean slugs / links
sub_pages = []
for a in soup.findAll("a"):
if a["href"].startswith("/"):
sub_page_href = a["href"]
if sub_page_href.startswith("/"):
sub_page_href = "https://www.notion.so" + a["href"]
if sub_page_href.startswith("https://www.notion.so/"):
# if the link is an anchor link,
# check if the page hasn't already been parsed
if "#" in sub_page_href: