mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-27 21:41:10 -05:00
word granularity
This commit is contained in:
parent
415e51eb5a
commit
ff1027a8d8
@ -239,7 +239,7 @@ class Pastes extends CI_Model
|
|||||||
include_once ('./application/libraries/finediff.php');
|
include_once ('./application/libraries/finediff.php');
|
||||||
$from_text = $row['raw'];
|
$from_text = $row['raw'];
|
||||||
$to_text = $data['raw'];
|
$to_text = $data['raw'];
|
||||||
$opcodes = FineDiff::getDiffOpcodes($from_text, $to_text);
|
$opcodes = FineDiff::getDiffOpcodes($from_text, $to_text, FineDiff::$wordGranularity);
|
||||||
$to_text = FineDiff::renderToTextFromOpcodes($from_text, $opcodes);
|
$to_text = FineDiff::renderToTextFromOpcodes($from_text, $opcodes);
|
||||||
$data['paste'] = $this->_format_diff(nl2br(FineDiff::renderDiffToHTMLFromOpcodes($from_text, $opcodes)));
|
$data['paste'] = $this->_format_diff(nl2br(FineDiff::renderDiffToHTMLFromOpcodes($from_text, $opcodes)));
|
||||||
}
|
}
|
||||||
@ -579,8 +579,8 @@ class Pastes extends CI_Model
|
|||||||
private
|
private
|
||||||
function _format_diff($text)
|
function _format_diff($text)
|
||||||
{
|
{
|
||||||
$text = explode("\n", $text);
|
$text = explode("\n", $text);
|
||||||
$text = '<ol><li>' . implode('</li><li>', $text) . '</li></ol>';
|
$text = '<ol><li>' . implode('</li><li>', $text) . '</li></ol>';
|
||||||
$text = '<div class="text" style="font-family:monospace;">' . $text . '</div>';
|
$text = '<div class="text" style="font-family:monospace;">' . $text . '</div>';
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user