Bug 8146 - Outdated nonsemantic markup in tlwebadm
Summary: Outdated nonsemantic markup in tlwebadm
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Web Administration (show other bugs)
Version: trunk
Hardware: Other Other
: P2 Normal
Target Milestone: 4.15.0
Assignee: Tobias
URL:
Keywords: linma_tester, prosaic
Depends on:
Blocks:
 
Reported: 2023-05-03 10:43 CEST by Tobias
Modified: 2023-05-09 16:51 CEST (History)
2 users (show)

See Also:
Acceptance Criteria:
* tlwebadmin should not contain the following nonsemantic markup tags: <b> : bold <i> : italics <u> : underline <s> : strike-through * EXTRA: autotest to detect use of such tags


Attachments

Description Tobias cendio 2023-05-03 10:43:25 CEST
We want to style everything using css and avoid semantic markup such as <b>, <i>, etc.
Comment 1 Tobias cendio 2023-05-03 10:51:51 CEST
For practical reasons, the scope of this bug is reduced to encompass only tlwebadm as opposed to all web interfaces.
Comment 3 Tobias cendio 2023-05-04 08:48:34 CEST
To clarify comment 0: we want to avoid styling elements with little or no semantic value. Elements such as <code> or <mark> are fine since they convey a meaning with room for interpretation of the specific styling.
Comment 4 Tobias cendio 2023-05-04 12:48:48 CEST
A list of nonsemantic markup tags (supported by HTML5) to avoid:
  <b>   : bold
  <i>   : italics
  <u>   : underline
  <s>   : strike-through
  <pre> : preformatted
  
One tag that comes close but gets a pass is <mark> where browsers will typically add a colored background like a marker pen; reason being there's room for interpretation what marking implies.
Comment 5 Tobias cendio 2023-05-04 13:23:32 CEST
Regarding comment 4, there are corresponding semantic tags that can be used in place of the listed tags. In some cases though, CSS is the best way. The point is that the tag label should convey some meaning.

bold           : <strong>, as in strong importance
italics        : <em>, as in emphasis
underline      : use CSS
strike-through : <del>, as in delete
preformatted   : use CSS
Comment 7 Tobias cendio 2023-05-04 17:26:08 CEST
(In reply to Tobias from comment #5)
> Regarding comment 4, there are corresponding semantic tags that can be used
> in place of the listed tags. In some cases though, CSS is the best way. The
> point is that the tag label should convey some meaning.
> 
> bold           : <strong>, as in strong importance
> italics        : <em>, as in emphasis
> underline      : use CSS
> strike-through : <del>, as in delete
> preformatted   : use CSS

The <pre> tag is left out of the cleansing for practical reasons. It's likely one would want a block-variant of <code> but there's no proper one available.
Comment 8 Tobias cendio 2023-05-04 17:31:11 CEST
Instances of nonsemantic markup tags in templates, as in <b> <i> <u> and <s>, have been fixed. In addition, an autotest has been added which checks templates for such unwanted tags.

Setting this as resolved.
Comment 9 Tobias cendio 2023-05-05 09:21:30 CEST
Reopening to make improvements on the tag substring searches.
Comment 11 Tobias cendio 2023-05-05 14:00:16 CEST
The autotest for unwanted tags has been updated.

Bug should be ready for testing now.
Comment 14 Linn cendio 2023-05-09 16:51:05 CEST
Checked the acceptance critera:

> * tlwebadmin should not contain the following nonsemantic markup tags:
>   <b>   : bold
>   <i>   : italics
>   <u>   : underline
>   <s>   : strike-through
Did git grep and could not find any variation of these tags remaining in Web Admin. Also looked through the web pages, and places that uses bold font does so through CSS and with the correct font-weight (600 for Poppins and 700 for Mulish). Could not find any places that used italics, underline or strike-through.


> * EXTRA: autotest to detect use of such tags
An autotest that checks for unwanted tags has been created, which helps making sure these tags are not added by mistake in the future. 


Also looked through the commits and the code looks good. Closing.

Note You need to log in before you can comment on or make changes to this bug.