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 #4859, #4530: Images in 'li' tags display in inline rather than block mode. #5286

Closed
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5c2f3d3
made concep card image block
Vishwajith-Shettigar Dec 23, 2023
0f53710
test fixed
Vishwajith-Shettigar Dec 23, 2023
8a562f1
test fixed
Vishwajith-Shettigar Dec 23, 2023
e3d5b50
Merge branch 'develop' into imageli
Vishwajith-Shettigar Dec 23, 2023
3b447f3
Merge branch 'develop' into imageli
Vishwajith-Shettigar Dec 23, 2023
3ffcc4c
Merge branch 'develop' into imageli
Vishwajith-Shettigar Jan 3, 2024
57cf81f
Merge branch 'develop' into imageli
Vishwajith-Shettigar Jan 10, 2024
d202f23
Merge branch 'develop' into imageli
Vishwajith-Shettigar Jan 17, 2024
ef7b4b5
Merge branch 'develop' into imageli
Vishwajith-Shettigar Jan 29, 2024
6e46146
addressed comments
Vishwajith-Shettigar Jan 29, 2024
d71bf6d
addressed comments
Vishwajith-Shettigar Jan 29, 2024
aada9eb
addressed comments
Vishwajith-Shettigar Jan 30, 2024
2d4a51c
addressed comments
Vishwajith-Shettigar Jan 30, 2024
fc1ac35
test modified
Vishwajith-Shettigar Feb 1, 2024
c89df02
recalculate drawableLft and right
Vishwajith-Shettigar Feb 2, 2024
37c9fb5
Merge branch 'develop' into imageli
Vishwajith-Shettigar Mar 1, 2024
8026966
Merge branch 'develop' into imageli
Vishwajith-Shettigar Mar 9, 2024
74cdbb2
Merge branch 'develop' into imageli
Vishwajith-Shettigar Jun 11, 2024
bdcc135
Merge branch 'develop' into imageli
Vishwajith-Shettigar Jun 13, 2024
0eda433
Merge branch 'develop' into imageli
Vishwajith-Shettigar Jun 22, 2024
d3d2bde
Merge branch 'develop' into imageli
Vishwajith-Shettigar Jul 3, 2024
44d27d5
Merge branch 'develop' into imageli
Vishwajith-Shettigar Aug 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,10 @@ class HtmlParserTest {
val imageSpans = htmlResult.getSpansFromWholeString(ImageSpan::class)
assertThat(imageSpans).hasLength(1)
assertThat(imageSpans.first().source).isEqualTo("test.png")

// Verify that the image span does not start/end with a space since there is other text present.
assertThat(htmlResult.toString()).startsWith("A")
assertThat(htmlResult.toString()).doesNotContain(" ")
assertThat(htmlResult.toString()[htmlResult.length - 1].toString()).doesNotContain(" ")
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ class HtmlParser private constructor(
htmlContent = modifiedHtmlContent
} else {
htmlContentTextView.textDirection = View.TEXT_DIRECTION_LTR
val regex = Regex("""<oppia-noninteractive-image [^>]*>.*?</oppia-noninteractive-image>""")
adhiamboperes marked this conversation as resolved.
Show resolved Hide resolved
val modifiedHtmlContent = rawString.replace(regex) {
val oppiaImageTag = it.value
adhiamboperes marked this conversation as resolved.
Show resolved Hide resolved
"""<div>$oppiaImageTag</div>"""
adhiamboperes marked this conversation as resolved.
Show resolved Hide resolved
}
htmlContent = modifiedHtmlContent
}

htmlContentTextView.invalidate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class UrlImageParser private constructor(
}

val drawableLeft = if (imageCenterAlign && !isRTLMode()) {
calculateInitialMargin(maxAvailableWidth, drawableWidth)
calculateInitialMargin(maxAvailableWidth - maxContentItemPadding, drawableWidth)
} else {
0f
}
Expand Down
Loading