Skip to main content

Day 77 of 100DaysOfSpec, 4.6 Edits (ins, del elements)

I am reading and taking notes on the HTML specifications for 100 days as part of #The100DayProject. Read the initial intent/backstory. I am a Microsoft employee but all opinions, comments, etc on this site are my own. I do not speak on behalf of my employer, and thus no comments should be taken as representative of Microsoft's official opinion of the spec. Subsections not listed below were read without comment.

Currently reading in 4.6 Edits

4.6.1 The ins element

“The ins element represents an addition to the document.”

  • cite attribute links to the edit source and/or more information.
  • datetime attribute gives the date and optional time for when the change was made.
  • Code examples given in the spec show an ins element wrapped around p. It would be a good idea to mark up an addition like this when there is no other in content in the p tag besides an addition. You wouldn’t (or shouldn’t) add an empty p tag to a document, so it also wouldn’t make semantic sense to have an addition to an otherwise empty paragraph.
  • ins elements should not cross implied paragraph boundaries.” (See spec for an example)

4.6.2 The del element

“The del element represents a removal from the document.”

  • Same cite and datetime attributes as the ins element.
  • Same rule about not crossing implied paragraphs.

4.6.3 Attributes common to ins and del elements

cite:

  • When the cite attribute points to a really long document, you’re encourage to use a “fragment identifier” (https://example.com/documentation#relevant-section for example) for the relevant portion of the cited document.
  • The cite value can be surfaced in a user agent’s UI so that they can follow the link to more info/context, but machines are the main benefactors of the attribute.

datetime:

  • If set, has to be a valid date string.
  • If the algorithm that parses this attribute doesn’t return a valid date, there is none associated with the edit element.
  • This is also a “private use” attribute can be shown to the user if the user agent (browser, etc.) wishes.

Responses

My blog uses Webmentions. Responses from Mastodon and other sites that send Webmentions will show up here.

No Webmentions have been sent to this post yet.