Fix image loading.
This commit is contained in:
parent
f482cb562b
commit
ff7c31701e
6 changed files with 59 additions and 5 deletions
1
test/requirements.txt
Normal file
1
test/requirements.txt
Normal file
|
@ -0,0 +1 @@
|
|||
pytest
|
14
test/test_img_replace.py
Normal file
14
test/test_img_replace.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
import markdown
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
md_input = """This is an image of a tree: 
|
||||
"""
|
||||
|
||||
def test_image_replace():
|
||||
|
||||
soup = BeautifulSoup(markdown.markdown(md_input), features="html.parser")
|
||||
|
||||
for img in soup.find_all('img'):
|
||||
img["src"] = "blah"
|
||||
|
||||
print(soup.prettify())
|
Loading…
Add table
Add a link
Reference in a new issue