Subject: bug#41031: Add facemenu-set-strong and facemenu-set-emphasis

From: Stefan Kangas <[email-masked]>
Date: Mon, 04 May 2020 00:44:58 +0200

tags 41031 + patch
found 41031 28.0.50
thanks

積丹尼 Dan Jacobson <[email-masked]> writes:

> Just the other day I was editing an .html file, and noticed
>
> M-o b		facemenu-set-bold
> M-o d		facemenu-set-default
> M-o i		facemenu-set-italic
> M-o l		facemenu-set-bold-italic
> M-o o		facemenu-set-face
> M-o u		facemenu-set-underline
>
> hadn't been updated to also include "strong" and "em",
> which we are now supposed to use in preference to
> "<b>" (bold) and "<i>" (italic), that it currently only inserts.

Indeed, we should probably prefer those tags (even for HTML5).  They
are also more accessible to people on screen readers.

Could you please test the attached patch and see that it resolves the
issue?

Best regards,
Stefan Kangas

>From 5cc040b8552463db67aede1aa94d716e0a09e76a Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Mon, 4 May 2020 00:35:07 +0200
Subject: [PATCH] Prefer 'strong' and 'em' to 'b' and 'i' in html-mode

* lisp/textmodes/sgml-mode.el (html-face-tag-alist): Prefer inserting
the '<strong>' and '<em>' tags to '<b> and '<i>' in
html-mode.  (Bug#41031)
* lisp/textmodes/sgml-mode.el (html-mode): Update docstring to do the
same.
---
 lisp/textmodes/sgml-mode.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 9b29b844d0..b5ff6a6967 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -1852,8 +1852,8 @@ html-mode-map
   "Keymap for commands for use in HTML mode.")
 
 (defvar html-face-tag-alist
-  '((bold . "b")
-    (italic . "i")
+  '((bold . "strong")
+    (italic . "em")
     (underline . "u")
     (mode-line . "rev"))
   "Value of `sgml-face-tag-alist' for HTML mode.")
@@ -2363,7 +2363,7 @@ html-mode
 
 <p>Paragraphs only need an opening tag.  Line breaks and multiple spaces are
 ignored unless the text is <pre>preformatted.</pre>  Text can be marked as
-<b>bold</b>, <i>italic</i> or <u>underlined</u> using the normal M-o or
+<strong>bold</strong>, <em>italic</em> or <u>underlined</u> using the normal M-o or
 Edit/Text Properties/Face commands.
 
 Pages can have <a name=\"SOMENAME\">named points</a> and can link other points
-- 
2.26.2