Skip to content

Anchor tags always gets underline text decoration when not none #1547

@NYJvanMuijlwijk

Description

@NYJvanMuijlwijk

Steps to Reproduce

  • in the customStylesBuilder, return 'text-decoration': 'line-through' for the anchor tag.
  • anchor tags will now display both an underline and the line-through
`HtmlWidget` configuration
    HtmlWidget(
      html,
      customStylesBuilder: (element) => switch (element.localName) {
        case 'a':
          return {'text-decoration': 'line-through'};
        default:
          return null;
      },
      onTapUrl: (url) {
        // handle url
      },
    );
Testing environment
[✓] Flutter (Channel stable, 3.38.9, on macOS 26.2 25C56 darwin-arm64, locale en-NL) [268ms]
    • Flutter version 3.38.9 on channel stable at /Users/niek/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 67323de285 (3 weeks ago), 2026-01-28 13:43:12 -0800
    • Engine revision 587c18f873
    • Dart version 3.10.8
    • DevTools version 2.51.1
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android,
      enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging

[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [1,184ms]
    • Android SDK at /Users/niek/Library/Android/sdk
    • Emulator version 36.3.10.0 (build_id 14472402) (CL:N/A)
    • Platform android-36, build-tools 36.1.0
    • ANDROID_HOME = /Users/niek/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/niek/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.2) [676ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17C52
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [6ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (3 available) [9.9s]
    • iPad Pro 13-inch (M5) (mobile) • 64A5D122-537D-4C41-B861-27506A28FF21 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-26-2 (simulator)
    • macOS (desktop)                • macos                                • darwin-arm64   • macOS 26.2 25C56
      darwin-arm64
    • Chrome (web)                   • chrome                               • web-javascript • Google Chrome
      145.0.7632.109

[✓] Network resources [243ms]
    • All expected network resources are available.

• No issues found!

Expected results

Only the given text decoration is displayed. In this case 'line-through' overrides the default 'underline'

Actual results

Image

Metadata

Metadata

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions