You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.
Hello, a very good feature would be to get reverse diff opcodes.
I would like to log all changes in my forum (on subject or responses). But I don't keep the old version, only the newer. So I would like to compute old versions from the last version, not the opposite.
I try to switch arguments when calling FineDiff::getDiffOpcodes($from, $to) :
But when I display, the difference (FineDiff::renderDiffToHTMLFromOpcodes), the modification are reversed (ins & del). So I tried something like :
$result = FineDiff::renderDiffToHTMLFromOpcodes($text, $opdiff);
// Replace ins by del & del by ins
$result = strtr($result, array('<del>' => '<ins>', '</del>' => '</ins>', '<ins>' => '<del>', '</ins>' => '</del>'));
// Swap ins & del
$result = preg_replace('#(<ins>.+?</ins>)(\s*)(<del>.+?</del>)#s', '$3$2$1', $result);
But, it's very ugly...
Could you do function FineDiff::getReverseDiffOpcodes for this case?
Thanks in advance,
Best Regards, Max
The text was updated successfully, but these errors were encountered:
Why not just CSS-restyle <ins> and <del> to each other style? The <ins> and <del> are semantically correct even when you "reverse" the diff, you just want a different visual it seems.
Hello, a very good feature would be to get reverse diff opcodes.
I would like to log all changes in my forum (on subject or responses). But I don't keep the old version, only the newer. So I would like to compute old versions from the last version, not the opposite.
I try to switch arguments when calling FineDiff::getDiffOpcodes($from, $to) :
But when I display, the difference (FineDiff::renderDiffToHTMLFromOpcodes), the modification are reversed (ins & del). So I tried something like :
But, it's very ugly...
Could you do function FineDiff::getReverseDiffOpcodes for this case?
Thanks in advance,
Best Regards, Max
The text was updated successfully, but these errors were encountered: