Skip to content
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

fix: Update markdownify from 0.14.1 to 1.1.0 to resolve text spacing issues #1083

Merged

Conversation

lynnzc
Copy link
Contributor

@lynnzc lynnzc commented Mar 20, 2025

Description

Updates markdownify package from version 0.14.1 to 1.1.0 to fix text spacing issues in the output formatting.

Test

import markdownify

res = markdownify.markdownify("""<div class="zTzk8e"><div class="PshwNb"><a jsname="wN9W3" class="P9159d hMk97e BbI1ub" href="https://www.theoutnet.com/en-us/shop/product/diane-von-furstenberg/dresses/maxi-dresses/marika-ruched-stretch-mesh-maxi-dress/1647597358895143?srsltid=AfmBOopCjONdX5fn2gWZhyCJmKhWmSdfDCD8Lz3-ChABbmQxcHCnSsoSOv8&amp;gQT=2" rel="noopener" target="_blank" data-hveid="128" data-ved="0ahUKEwjc35TqqpiMAxWCMEQIHauGLnAQj_IECIAB" ping="/url?sa=t&amp;source=web&amp;rct=j&amp;url=https://www.theoutnet.com/en-us/shop/product/diane-von-furstenberg/dresses/maxi-dresses/marika-ruched-stretch-mesh-maxi-dress/1647597358895143%3Fsrsltid%3DAfmBOopCjONdX5fn2gWZhyCJmKhWmSdfDCD8Lz3-ChABbmQxcHCnSsoSOv8%26gQT%3D2&amp;ved=0ahUKEwjc35TqqpiMAxWCMEQIHauGLnAQj_IECIAB&amp;opi=89978449"><div><div class="keF4Wd b8zvM"><div class="uXJVPd gfKE6c"><div class="EHWXMb RLo00b"><div class="Ncoygd"><div class="EHWXMb j6sxFe"><div class="EHWXMb"><div class="tLevwc"><g-img aria-hidden="true"><img id="dimg_Vd7bZ5zhAoLhkPIPq426gQc_21" src="https://encrypted-tbn0.gstatic.com/faviconV2?url=https://www.theoutnet.com&amp;client=SHOPPING&amp;size=32&amp;type=FAVICON&amp;fallback_opts=TYPE,SIZE,URL" data-deferred="3" class="YQ4gaf zr758c" height="16" width="16" alt="" data-csiid="Vd7bZ5zhAoLhkPIPq426gQc_1" data-ims="1742462549665" data-iml="1742462550215"></g-img></div><div class="gUf0b uWvFpd hP4iBf" data-report-feedback-about-context="THE OUTNET">THE OUTNET</div></div><span class="xMxKh" aria-label="Rated 4 out of 5."><span class="NFq8Ad cHaqb" aria-hidden="true">4.0/5</span><span class="qFncFc z1asCe" aria-hidden="true" style="height:16px;line-height:16px;width:16px"><svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"></path></svg></span></span></div></div><div class="QcEgce qUbqne WbrF3c"><div class="Xs9evb"><div><span class="Pgbknd xUrPFc" aria-label="Current price is $249.00."><span aria-hidden="true">$249.00</span></span></div></div></div></div><div class="UPworb Ku9xBf"><span><span>50% off</span></span><div> </div><div><div class="AoPnCe JPwIxc tBtgqf"><span aria-label="Old price was $498."><span aria-hidden="true">$498</span></span></div></div></div><div><div class="NV5awf AiiGt"><div class="OaQPmf rArxUc"><span class="gASiG"><span class="gASiG jvP2Jb jIpmhc"><span>In stock online</span></span></span></div><div class="Z8dN6c"><span class="gASiG"><span class="gASiG" aria-label="Free delivery from March 25 to 28"><span>Free delivery Mar 25 – 28</span></span></span></div><div class="Z8dN6c"><span class="Wvm8Ob" aria-hidden="true">·</span><span class="gASiG"><span class="gASiG"><span>28-day returns</span></span></span></div></div></div></div></div></div></a><div class="mVhlhf" data-hveid="139"><div class="VhS4Dc DY4Ebb"><div class="uItbPc gG4ZN"><div>Base price</div><div class="nzjx1d"></div><div class="qG8UEe"><span>$249.00</span></div></div><div class="uItbPc BGQfYc gG4ZN"><div>Was</div><div class="nzjx1d"></div><div class="qG8UEe fVreKf">$498.00</div></div><div class="uItbPc gG4ZN"><div>Delivery fee</div><div class="nzjx1d"></div><div class="qG8UEe">Free</div></div><div class="uItbPc gG4ZN"><div>Estimated tax</div><div class="nzjx1d"></div><div class="qG8UEe">+ $25.52</div></div><div class="uItbPc HcqNjd LZX41d Tb23Fb"><div class="e63ZSc">Estimated total</div><div class="f4jpac"><div class="s5lJIe"><div class="nzjx1d"></div><div class="qG8UEe">$274.52</div></div></div></div></div><div class="ab3nF"><div class="GACihf"><div class="Lnvk3"><div class="XzuhHf"><a href="https://www.theoutnet.com/en-us/shop/product/diane-von-furstenberg/dresses/maxi-dresses/marika-ruched-stretch-mesh-maxi-dress/1647597358895143?srsltid=AfmBOopCjONdX5fn2gWZhyCJmKhWmSdfDCD8Lz3-ChABbmQxcHCnSsoSOv8" target="_blank" data-hveid="140" ping="/url?sa=t&amp;source=web&amp;rct=j&amp;url=https://www.theoutnet.com/en-us/shop/product/diane-von-furstenberg/dresses/maxi-dresses/marika-ruched-stretch-mesh-maxi-dress/1647597358895143%3Fsrsltid%3DAfmBOopCjONdX5fn2gWZhyCJmKhWmSdfDCD8Lz3-ChABbmQxcHCnSsoSOv8&amp;ved=0ahUKEwjc35TqqpiMAxWCMEQIHauGLnAQlesKCIwB&amp;opi=89978449"><div class="SYULCe btku5b fCrZyc NQYJvc expUPd"><div class="niO4u VDgVie SlP8xc"><div class="kHtcsd"><span class="clOx1e sjVJQd">Visit site</span></div></div></div></a></div><div class="XzuhHf"><div data-gpcid="" data-merchantid="118643736" data-oid="6155971540288575473" data-ut="0" jsaction="gb2PWd:trigger.MsNTVb" data-ved="0ahUKEwjc35TqqpiMAxWCMEQIHauGLnAQ1O4JCI4B"><div role="button" tabindex="0" jsaction="trigger.gb2PWd"><div class="qEITGe btku5b fCrZyc NQYJvc FR7ZSc"><div class="niO4u VDgVie SlP8xc"><div class="kHtcsd"><span class="clOx1e sjVJQd">View details</span></div></div></div></div></div></div></div></div></div><div class="bvUqFe"></div></div></div></div>""")
print(res)

Before

Text elements were concatenated without proper spacing:
image

After

Text elements are properly spaced:
image

@CLAassistant
Copy link

CLAassistant commented Mar 20, 2025

CLA assistant check
All committers have signed the CLA.

@MagMueller MagMueller merged commit 2cd973e into browser-use:main Mar 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants