Repository navigation
[markdown] Omit the link and image title when the HTML has none - #8938
Merged
dlwh merged 1 commit intoSep 11, 2026
Merged
Conversation
Render an anchor or image with no title attribute as [text](href) and
. convert_a and convert_img built the title suffix as
' "{title}"'.format(title=... if title else ""), so the conditional chose
between the escaped title and an empty string inside the quotes instead of
choosing between the suffix and no suffix. markdownify applies the
conditional to the whole suffix, which is why its output carries no
trailing "".
The default ResiliparseConfig keeps links and images, so this reached the
web extraction path. Regenerating the fixtures with
tests/snapshots/generate_expected.py removes 161 empty titles over 106
lines in 8 of the 11 web/expected/resiliparse files and changes nothing
else. The wiki, ar5iv, stackexchange and dclm_hq fixtures are unchanged
because those configs set include_links=False and include_images=False.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Render an anchor or image with no
titleattribute as[text](href)and.convert_aandconvert_imgbuilt the title suffix as' "{title}"'.format(title=... if title else ""), so the conditional chose between the escaped title and an empty string inside the quotes instead of choosing between the suffix and no suffix. markdownify applies the conditional to the whole suffix, which is why its output carries no trailing"".The default
ResiliparseConfigkeeps links and images, so this reached the web extraction path. Regenerating the fixtures withtests/snapshots/generate_expected.pyremoves 161 empty titles over 106 lines in 8 of the 11tests/snapshots/web/expected/resiliparsefiles and changes nothing else. The wiki, ar5iv, stackexchange and dclm_hq fixtures are unchanged because those configs setinclude_links=Falseandinclude_images=False.