Swapped out HTML diff implementation for own, removes tidy depdendancy

This commit is contained in:
Dan Brown 2020-11-29 19:08:13 +00:00
parent bf8716bb22
commit 0b01a77c16
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
3 changed files with 52 additions and 108 deletions

View File

@ -3,7 +3,7 @@
use BookStack\Entities\Tools\PageContent;
use BookStack\Entities\Repos\PageRepo;
use BookStack\Exceptions\NotFoundException;
use GatherContent\Htmldiff\Htmldiff;
use Ssddanbrown\HtmlDiff\Diff;
class PageRevisionController extends Controller
{
@ -72,7 +72,7 @@ class PageRevisionController extends Controller
$prev = $revision->getPrevious();
$prevContent = $prev->html ?? '';
$diff = (new Htmldiff)->diff($prevContent, $revision->html);
$diff = Diff::excecute($prevContent, $revision->html);
$page->fill($revision->toArray());
// TODO - Refactor PageContent so we don't need to juggle this

View File

@ -11,14 +11,12 @@
"ext-gd": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-tidy": "*",
"ext-xml": "*",
"barryvdh/laravel-dompdf": "^0.8.6",
"barryvdh/laravel-snappy": "^0.4.7",
"doctrine/dbal": "^2.9",
"facade/ignition": "^1.4",
"fideloper/proxy": "^4.0",
"gathercontent/htmldiff": "^0.2.1",
"intervention/image": "^2.5",
"laravel/framework": "^6.18",
"laravel/socialite": "^4.3.2",
@ -32,7 +30,8 @@
"socialiteproviders/microsoft-azure": "^3.0",
"socialiteproviders/okta": "^1.0",
"socialiteproviders/slack": "^3.0",
"socialiteproviders/twitch": "^5.0"
"socialiteproviders/twitch": "^5.0",
"ssddanbrown/htmldiff": "^1.0"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2.8",

151
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "34390536dd685e0bc49b179babaa06ec",
"content-hash": "a61fd1c287bd93fa496202c6583c7bb1",
"packages": [
{
"name": "aws/aws-sdk-php",
@ -214,57 +214,6 @@
],
"time": "2020-09-07T12:33:10+00:00"
},
{
"name": "cogpowered/finediff",
"version": "0.3.1",
"source": {
"type": "git",
"url": "https://github.com/cogpowered/FineDiff.git",
"reference": "339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cogpowered/FineDiff/zipball/339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8",
"reference": "339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"mockery/mockery": "*",
"phpunit/phpunit": "*"
},
"type": "library",
"autoload": {
"psr-0": {
"cogpowered\\FineDiff": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Rob Crowe",
"email": "rob@cogpowered.com"
},
{
"name": "Raymond Hill"
}
],
"description": "PHP implementation of a Fine granularity Diff engine",
"homepage": "https://github.com/cogpowered/FineDiff",
"keywords": [
"diff",
"finediff",
"opcode",
"string",
"text"
],
"time": "2014-05-19T10:25:02+00:00"
},
{
"name": "doctrine/cache",
"version": "1.10.2",
@ -1203,55 +1152,6 @@
],
"time": "2020-06-14T09:00:00+00:00"
},
{
"name": "gathercontent/htmldiff",
"version": "0.2.1",
"source": {
"type": "git",
"url": "https://github.com/gathercontent/htmldiff.git",
"reference": "24674a62315f64330134b4a4c5b01a7b59193c93"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/gathercontent/htmldiff/zipball/24674a62315f64330134b4a4c5b01a7b59193c93",
"reference": "24674a62315f64330134b4a4c5b01a7b59193c93",
"shasum": ""
},
"require": {
"cogpowered/finediff": "0.3.1",
"ext-tidy": "*"
},
"require-dev": {
"phpunit/phpunit": "4.*",
"squizlabs/php_codesniffer": "1.*"
},
"type": "library",
"autoload": {
"psr-0": {
"GatherContent\\Htmldiff": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Andrew Cairns",
"email": "andrew@gathercontent.com"
},
{
"name": "Mathew Chapman",
"email": "mat@gathercontent.com"
},
{
"name": "Peter Legierski",
"email": "peter@gathercontent.com"
}
],
"description": "Compare two HTML strings",
"time": "2015-04-15T15:39:46+00:00"
},
{
"name": "guzzlehttp/guzzle",
"version": "6.5.5",
@ -3625,6 +3525,52 @@
"description": "Twitch OAuth2 Provider for Laravel Socialite",
"time": "2020-05-06T22:51:30+00:00"
},
{
"name": "ssddanbrown/htmldiff",
"version": "v1.0.0",
"source": {
"type": "git",
"url": "https://github.com/ssddanbrown/HtmlDiff.git",
"reference": "d1978c7d1c685800997f982a0ae9cff1e45df70c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ssddanbrown/HtmlDiff/zipball/d1978c7d1c685800997f982a0ae9cff1e45df70c",
"reference": "d1978c7d1c685800997f982a0ae9cff1e45df70c",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": ">=7.2"
},
"require-dev": {
"phpunit/phpunit": "^8.5|^9.4.3"
},
"type": "library",
"autoload": {
"psr-4": {
"Ssddanbrown\\HtmlDiff\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Dan Brown",
"email": "ssddanbrown@googlemail.com",
"role": "Developer"
}
],
"description": "HTML Content Diff Generator",
"homepage": "https://github.com/ssddanbrown/htmldiff",
"support": {
"issues": "https://github.com/ssddanbrown/HtmlDiff/issues",
"source": "https://github.com/ssddanbrown/HtmlDiff/tree/v1.0.0"
},
"time": "2020-11-29T18:38:45+00:00"
},
{
"name": "swiftmailer/swiftmailer",
"version": "v6.2.3",
@ -8690,12 +8636,11 @@
"ext-gd": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-tidy": "*",
"ext-xml": "*"
},
"platform-dev": [],
"platform-overrides": {
"php": "7.2.0"
},
"plugin-api-version": "1.1.0"
"plugin-api-version": "2.0.0"
}