mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 05:36:00 +00:00
Swapped out HTML diff implementation for own, removes tidy depdendancy
This commit is contained in:
parent
bf8716bb22
commit
0b01a77c16
@ -3,7 +3,7 @@
|
|||||||
use BookStack\Entities\Tools\PageContent;
|
use BookStack\Entities\Tools\PageContent;
|
||||||
use BookStack\Entities\Repos\PageRepo;
|
use BookStack\Entities\Repos\PageRepo;
|
||||||
use BookStack\Exceptions\NotFoundException;
|
use BookStack\Exceptions\NotFoundException;
|
||||||
use GatherContent\Htmldiff\Htmldiff;
|
use Ssddanbrown\HtmlDiff\Diff;
|
||||||
|
|
||||||
class PageRevisionController extends Controller
|
class PageRevisionController extends Controller
|
||||||
{
|
{
|
||||||
@ -72,7 +72,7 @@ class PageRevisionController extends Controller
|
|||||||
|
|
||||||
$prev = $revision->getPrevious();
|
$prev = $revision->getPrevious();
|
||||||
$prevContent = $prev->html ?? '';
|
$prevContent = $prev->html ?? '';
|
||||||
$diff = (new Htmldiff)->diff($prevContent, $revision->html);
|
$diff = Diff::excecute($prevContent, $revision->html);
|
||||||
|
|
||||||
$page->fill($revision->toArray());
|
$page->fill($revision->toArray());
|
||||||
// TODO - Refactor PageContent so we don't need to juggle this
|
// TODO - Refactor PageContent so we don't need to juggle this
|
||||||
|
@ -11,14 +11,12 @@
|
|||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-tidy": "*",
|
|
||||||
"ext-xml": "*",
|
"ext-xml": "*",
|
||||||
"barryvdh/laravel-dompdf": "^0.8.6",
|
"barryvdh/laravel-dompdf": "^0.8.6",
|
||||||
"barryvdh/laravel-snappy": "^0.4.7",
|
"barryvdh/laravel-snappy": "^0.4.7",
|
||||||
"doctrine/dbal": "^2.9",
|
"doctrine/dbal": "^2.9",
|
||||||
"facade/ignition": "^1.4",
|
"facade/ignition": "^1.4",
|
||||||
"fideloper/proxy": "^4.0",
|
"fideloper/proxy": "^4.0",
|
||||||
"gathercontent/htmldiff": "^0.2.1",
|
|
||||||
"intervention/image": "^2.5",
|
"intervention/image": "^2.5",
|
||||||
"laravel/framework": "^6.18",
|
"laravel/framework": "^6.18",
|
||||||
"laravel/socialite": "^4.3.2",
|
"laravel/socialite": "^4.3.2",
|
||||||
@ -32,7 +30,8 @@
|
|||||||
"socialiteproviders/microsoft-azure": "^3.0",
|
"socialiteproviders/microsoft-azure": "^3.0",
|
||||||
"socialiteproviders/okta": "^1.0",
|
"socialiteproviders/okta": "^1.0",
|
||||||
"socialiteproviders/slack": "^3.0",
|
"socialiteproviders/slack": "^3.0",
|
||||||
"socialiteproviders/twitch": "^5.0"
|
"socialiteproviders/twitch": "^5.0",
|
||||||
|
"ssddanbrown/htmldiff": "^1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"barryvdh/laravel-debugbar": "^3.2.8",
|
"barryvdh/laravel-debugbar": "^3.2.8",
|
||||||
|
151
composer.lock
generated
151
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "34390536dd685e0bc49b179babaa06ec",
|
"content-hash": "a61fd1c287bd93fa496202c6583c7bb1",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "aws/aws-sdk-php",
|
"name": "aws/aws-sdk-php",
|
||||||
@ -214,57 +214,6 @@
|
|||||||
],
|
],
|
||||||
"time": "2020-09-07T12:33:10+00:00"
|
"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",
|
"name": "doctrine/cache",
|
||||||
"version": "1.10.2",
|
"version": "1.10.2",
|
||||||
@ -1203,55 +1152,6 @@
|
|||||||
],
|
],
|
||||||
"time": "2020-06-14T09:00:00+00:00"
|
"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",
|
"name": "guzzlehttp/guzzle",
|
||||||
"version": "6.5.5",
|
"version": "6.5.5",
|
||||||
@ -3625,6 +3525,52 @@
|
|||||||
"description": "Twitch OAuth2 Provider for Laravel Socialite",
|
"description": "Twitch OAuth2 Provider for Laravel Socialite",
|
||||||
"time": "2020-05-06T22:51:30+00:00"
|
"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",
|
"name": "swiftmailer/swiftmailer",
|
||||||
"version": "v6.2.3",
|
"version": "v6.2.3",
|
||||||
@ -8690,12 +8636,11 @@
|
|||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-tidy": "*",
|
|
||||||
"ext-xml": "*"
|
"ext-xml": "*"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
"platform-overrides": {
|
"platform-overrides": {
|
||||||
"php": "7.2.0"
|
"php": "7.2.0"
|
||||||
},
|
},
|
||||||
"plugin-api-version": "1.1.0"
|
"plugin-api-version": "2.0.0"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user