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
ins element represents an addition to the document.”
citeattribute links to the edit source and/or more information.
datetimeattribute gives the date and optional time for when the change was made.
- Code examples given in the spec show an
inselement 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
ptag besides an addition. You wouldn’t (or shouldn’t) add an empty
ptag to a document, so it also wouldn’t make semantic sense to have an addition to an otherwise empty paragraph.
inselements should not cross implied paragraph boundaries.” (See spec for an example)
4.6.2 The del element
del element represents a removal from the document.”
datetimeattributes as the
- Same rule about not crossing implied paragraphs.
4.6.3 Attributes common to ins and del elements
- When the
citeattribute points to a really long document, you’re encourage to use a “fragment identifier” (
http://example.com/documentation#relevant-sectionfor example) for the relevant portion of the cited document.
citevalue 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.
- 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.