Skip to content

Commit

Permalink
Merge pull request #4839 from wikimedia/image-recs/image-details-mark…
Browse files Browse the repository at this point in the history
…down

Remove underscores and html strings from add image details view
  • Loading branch information
mazevedofs committed May 3, 2024
2 parents c7f6032 + 6a532d3 commit 4b16076
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Wikipedia/Code/ExploreViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,11 @@ extension ExploreViewController: WKImageRecommendationsDelegate {

if let imageURL = URL(string: imageData.descriptionURL),
let thumbURL = URL(string: imageData.thumbUrl) {
let searchResult = InsertMediaSearchResult(fileTitle: "File:\(imageData.filename)", displayTitle: imageData.filename, thumbnailURL: thumbURL, imageDescription: imageData.description, filePageURL: imageURL)

let fileName = imageData.filename.normalizedPageTitle ?? imageData.filename
let imageDescription = imageData.description?.removingHTML
let searchResult = InsertMediaSearchResult(fileTitle: "File:\(imageData.filename)", displayTitle: fileName, thumbnailURL: thumbURL, imageDescription: imageDescription, filePageURL: imageURL)

let insertMediaViewController = InsertMediaSettingsViewController(image: image, searchResult: searchResult, fromImageRecommendations: true, delegate: self, imageRecLoggingDelegate: self, theme: theme)
self.imageRecommendationsViewModel = viewModel
navigationController?.pushViewController(insertMediaViewController, animated: true)
Expand Down
2 changes: 1 addition & 1 deletion Wikipedia/Code/InsertMediaSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ final class InsertMediaSettingsViewController: ViewController {
private lazy var imageView: InsertMediaSettingsImageView = {
let imageView = InsertMediaSettingsImageView.wmf_viewFromClassNib()!
imageView.image = image
imageView.imageDescription = searchResult.imageDescription
imageView.imageDescription = searchResult.imageDescription ?? searchResult.imageInfo?.imageDescription
imageView.title = searchResult.displayTitle
imageView.titleURL = imageTitle
imageView.titleAction = { [weak self] url in
Expand Down

0 comments on commit 4b16076

Please sign in to comment.