From b0567e5004923bf144421f189b1777a15f61dc36 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 20 Nov 2023 10:42:37 +0200 Subject: [PATCH] Fixes #2117 - Disable underlining for links defined in the html body: - https://github.com/Cocoanetics/DTCoreText/issues/898 --- .../Sources/Other/HTMLParsing/AttributedStringBuilder.swift | 3 ++- .../__Snapshots__/PreviewTests/test_formattedBodyText.1.png | 4 ++-- .../__Snapshots__/PreviewTests/test_formattedBodyText.2.png | 4 ++-- changelog.d/2117.bugfix | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 changelog.d/2117.bugfix diff --git a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilder.swift b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilder.swift index bf4f5e772..07192873b 100644 --- a/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilder.swift +++ b/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilder.swift @@ -92,7 +92,8 @@ struct AttributedStringBuilder: AttributedStringBuilderProtocol { DTDefaultFontFamily: defaultFont.familyName, DTDefaultFontName: defaultFont.fontName, DTDefaultFontSize: defaultFont.pointSize, - DTDefaultStyleSheet: DTCSSStylesheet(styleBlock: defaultCSS) as Any + DTDefaultStyleSheet: DTCSSStylesheet(styleBlock: defaultCSS) as Any, + DTDefaultLinkDecoration: false ] guard let builder = DTHTMLAttributedStringBuilder(html: data, options: parsingOptions, documentAttributes: nil) else { diff --git a/UnitTests/__Snapshots__/PreviewTests/test_formattedBodyText.1.png b/UnitTests/__Snapshots__/PreviewTests/test_formattedBodyText.1.png index 1f7a2362b..4a37acb24 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_formattedBodyText.1.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_formattedBodyText.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b689d76c95de930e792bfbe6ffb86bb9e006958fa77a55ed0aba7ad69432530f -size 212484 +oid sha256:8388baf6d6dff565d85ce4e75053f465a923e3e3216649e860f8103fe2bf2293 +size 212392 diff --git a/UnitTests/__Snapshots__/PreviewTests/test_formattedBodyText.2.png b/UnitTests/__Snapshots__/PreviewTests/test_formattedBodyText.2.png index 343603dc6..242d3289b 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_formattedBodyText.2.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_formattedBodyText.2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:16ca3e2a15fd004ff1372409fac07bac16ff8b053c72a8e2acc9975afbe9957f -size 185944 +oid sha256:9995de3534f0a609805d432a56b687debebf954972982d32a4436c335ce66c7a +size 185873 diff --git a/changelog.d/2117.bugfix b/changelog.d/2117.bugfix new file mode 100644 index 000000000..98f740aaa --- /dev/null +++ b/changelog.d/2117.bugfix @@ -0,0 +1 @@ +Disable underlining for links defined in the html body \ No newline at end of file