diff --git a/iphone/Maps/Categories/NSAttributedString+HTML.swift b/iphone/Maps/Categories/NSAttributedString+HTML.swift index 211c4c5055..49ca56c283 100644 --- a/iphone/Maps/Categories/NSAttributedString+HTML.swift +++ b/iphone/Maps/Categories/NSAttributedString+HTML.swift @@ -13,6 +13,13 @@ extension NSAttributedString { } extension NSMutableAttributedString { + @objc convenience init?(htmlString: String, baseFont: UIFont, paragraphStyle: NSParagraphStyle?) { + self.init(htmlString: htmlString, baseFont: baseFont) + if let paragraphStyle = paragraphStyle { + addAttribute(.paragraphStyle, value: paragraphStyle, range: NSMakeRange(0, length)) + } + } + @objc convenience init?(htmlString: String, baseFont: UIFont) { guard let data = htmlString.data(using: .utf8) else { return nil } diff --git a/iphone/Maps/UI/PlacePage/PlacePageDescriptionViewController.swift b/iphone/Maps/UI/PlacePage/PlacePageDescriptionViewController.swift index 4e595612ef..9cb32e2716 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageDescriptionViewController.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageDescriptionViewController.swift @@ -12,8 +12,17 @@ final class PlacePageDescriptionViewController: WebViewController { } override func configuredHtml(withText htmlText: String) -> String { - var html = htmlText.replacingOccurrences(of: "
", with: "") - html = html.replacingOccurrences(of: "", with: "wikipedia.org
") + let scale = UIScreen.main.scale + let styleTags = """ + + + + + """ + var html = htmlText.replacingOccurrences(of: "", with: styleTags) + html = html.replacingOccurrences(of: "", with: "wikipedia.org
") return html } diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/DescriptionCell/MWMPlaceDescriptionCell.mm b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/DescriptionCell/MWMPlaceDescriptionCell.mm index cd09a951b4..7fb35c01c4 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/DescriptionCell/MWMPlaceDescriptionCell.mm +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/Content/DescriptionCell/MWMPlaceDescriptionCell.mm @@ -12,8 +12,7 @@ @implementation MWMPlaceDescriptionCell -- (void)configureWithDescription:(NSString *)text delegate:(id