diff --git a/src/document/html/renderer.c b/src/document/html/renderer.c
index 82965111e..1c52f792a 100644
--- a/src/document/html/renderer.c
+++ b/src/document/html/renderer.c
@@ -349,11 +349,6 @@ get_format_screen_char(struct html_context *html_context,
copy_struct(&ta_cache, &format.style);
struct text_style final_style = format.style;
- if (link_state != LINK_STATE_NONE
- && html_context->options->underline_links) {
- final_style.attr |= AT_UNDERLINE;
- }
-
get_screen_char_template(&schar_cache, html_context->options, final_style);
}
@@ -361,6 +356,10 @@ get_format_screen_char(struct html_context *html_context,
^ !!renderer_context.nosearchable) {
schar_cache.attr ^= SCREEN_ATTR_UNSEARCHABLE;
}
+ if (link_state != LINK_STATE_NONE
+ && html_context->options->underline_links) {
+ schar_cache.attr |= SCREEN_ATTR_UNDERLINE;
+ }
return &schar_cache;
}