Looking into diff further, i wonder if it would be better semantics to use the <del> and <ins> tags for deleted and inserted code respectively.
Thus <span class="diffchange"> would become <ins class="diffchange"> and <del class="diffchange"> respectively in these cases.
It may be possible with a theme override as well.

CommentFileSizeAuthor
#9 Screenshot from 2016-12-05 13-39-21.png228.64 KBdrobnjak

Comments

broon’s picture

I was just stumbling across this, too. Currently, there is a possibility to distinguish them by the classes of the containing table cells: diff-deletedline and diff-addedline. Thus, it can be used in CSS to style it like < ins > and < del > tags.

td.diff-deletedline span.diffchange { text-decoration: line-through; }

Alternatively, with some jQuery it's possible to change the tags:

$('td.diff-deletedline span.diffchange').each(function(index){$(this).after('<del class="diffchange">'+ $(this).html() +'</dev>').remove();});

Regards,
sin

mitchell’s picture

Status: Active » Fixed

Recent commits to the 7.x-3.x very likely cover this. Therefore marking this as fixed. Please reopen if this isn't in the latest dev branch.

alan d.’s picture

Note, that the HTML classes should all now be there, but there is no option for DEL / INS option.

mitchell’s picture

Title: del and ins instead of span » Add HTML class option for DEL / INS instead of SPAN
Version: 6.x-2.x-dev » 7.x-3.x-dev
Assigned: whatdoesitwant » Unassigned
Status: Fixed » Active
alan d.’s picture

Title: Add HTML class option for DEL / INS instead of SPAN » Add HTML class option for DEL / INS instead of SPAN (for D8 port)
Category: feature » task
Status: Active » Postponed

Not sure about 6.x, but you can easily theme this by overriding theme_diff_inline_chunk() in Diff 7.x-3.x and this avoids additional admin settings to select one or the other.

However, changing these elements would probably be the best solution. Best time would be when porting the module to 8.x to avoid upgrade headaches.

Note that this change results in having to fix a lot of CSS, "span.diff-deleted" etc.

alan d.’s picture

Title: Add HTML class option for DEL / INS instead of SPAN (for D8 port) » Use DEL / INS instead of SPAN
Version: 7.x-3.x-dev » 8.x-1.x-dev
Priority: Minor » Normal
Issue summary: View changes
Status: Postponed » Active

Bumping to 8.x, too big of change this late for 7.x

Visual inline already uses this, so the issue is applicable to Split fields / Unified fields.

miro_dietiker’s picture

Priority: Normal » Major

OK let's give it a last-minute try. Promoting for decision if 8.x-1.x right now, or later, or no more possible because we again would break things.

drobnjak’s picture

Assigned: Unassigned » drobnjak

Started working on this

drobnjak’s picture

Status: Active » Closed (won't fix)
StatusFileSize
new228.64 KB

Diff module is using formatter directly from core. On the screenshot provided, row that is creating improper syntax is highlighted. However, this change would require further changes, as it is displayed in the stack trace, which would require huge amount of time.
Issue for changing syntax is therefore more core related - #2833101: Use DEL / INS tags for Diff comparions changes rather than SPAN.diffchange