Skip to content

Commit 8aa6077

Browse files
authored
Merge pull request #4259 from JetBrains/pdf-improvments
Pdf generator improvements
2 parents d9340d7 + 1f5ec3b commit 8aa6077

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/pdf.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ def transform_book_content(path_file):
6767

6868
soup = BeautifulSoup(html, "html.parser")
6969

70+
for node in soup.select('img[src^="images/https://"]'):
71+
print('Fix image link "%s"' % node["src"])
72+
node['src'] = node["src"][7:]
73+
node['data-dark-src'] = node["data-dark-src"][7:]
74+
75+
for page in soup.select('[id="test-page.md"], [id="kotlin-brand-assets.md-kotlin-night-brand-assets"]'):
76+
print("Drop %s" % page['id'])
77+
page.find_parent('section').decompose()
78+
7079
result_file = get_tmp_filename(path_file)
7180

7281
with open(result_file, "w", encoding='utf-8') as output:

0 commit comments

Comments
 (0)