Remove jonnybarnes/unicode-tools dependency

This commit is contained in:
Jonny Barnes 2016-06-09 00:49:33 +01:00
parent d09e63d509
commit c815d40be4
5 changed files with 5 additions and 55 deletions

View file

@ -3,7 +3,6 @@
namespace App;
use Illuminate\Database\Eloquent\Model;
use Jonnybarnes\UnicodeTools\UnicodeTools;
use League\CommonMark\CommonMarkConverter;
use MartinBean\Database\Eloquent\Sluggable;
use Illuminate\Database\Eloquent\SoftDeletes;
@ -57,9 +56,8 @@ class Article extends Model
*/
public function getMainAttribute($value)
{
$unicode = new UnicodeTools();
$markdown = new CommonMarkConverter();
$html = $markdown->convertToHtml($unicode->convertUnicodeCodepoints($value));
$html = $markdown->convertToHtml($value);
//change <pre><code>[lang] ~> <pre><code data-language="lang">
$match = '/<pre><code>\[(.*)\]\n/';
$replace = '<pre><code class="language-$1">';

View file

@ -5,7 +5,6 @@ namespace App;
use Normalizer;
use Jonnybarnes\IndieWeb\Numbers;
use Illuminate\Database\Eloquent\Model;
use Jonnybarnes\UnicodeTools\UnicodeTools;
use League\CommonMark\CommonMarkConverter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;
@ -98,10 +97,8 @@ class Note extends Model implements HasMedia
*/
public function getNoteAttribute($value)
{
$unicode = new UnicodeTools();
$codepoints = $unicode->convertUnicodeCodepoints($value);
$markdown = new CommonMarkConverter();
$html = $markdown->convertToHtml($codepoints);
$html = $markdown->convertToHtml($value);
$hcards = $this->makeHCards($html);
$hashtags = $this->autoLinkHashtag($hcards);

View file

@ -2,6 +2,7 @@
## Version {next}
- Better tag normalization code organisation
- Remove `jonnybarnes/unicode-tools` dependency and clean up relevant code
## Version 0.0.2 (2016-05-25)
- Fix issue#1: tagged notes page needs the tag from the URL normalizing.

View file

@ -8,7 +8,6 @@
"ext-intl": "*",
"php": ">=7.0.0",
"laravel/framework": "5.2.*",
"jonnybarnes/unicode-tools": "dev-master",
"jonnybarnes/indieweb": "dev-master",
"jonnybarnes/webmentions-parser": "dev-master",
"guzzlehttp/guzzle": "~6.0",

49
composer.lock generated
View file

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "52bfae9a802b8b7a53d83918045a0d67",
"content-hash": "08624d66bf872209171586433dfd5150",
"hash": "ae25cd7787df367a650bf7dc2fa74227",
"content-hash": "7982802429d5fe540f528ec69c3d84d2",
"packages": [
{
"name": "anahkiasen/underscore-php",
@ -1085,50 +1085,6 @@
],
"time": "2016-01-14 15:10:20"
},
{
"name": "jonnybarnes/unicode-tools",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/jonnybarnes/unicode-tools.git",
"reference": "0f469c30cb9a40a1cb578f893b3af1abc1a6ff53"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jonnybarnes/unicode-tools/zipball/0f469c30cb9a40a1cb578f893b3af1abc1a6ff53",
"reference": "0f469c30cb9a40a1cb578f893b3af1abc1a6ff53",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "3.7.*"
},
"type": "library",
"autoload": {
"psr-0": {
"Jonnybarnes\\UnicodeTools": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jonny Barnes",
"email": "jonny@jonnybarnes.net"
}
],
"description": "Turns Unicode codepoints into raw utf-8 multibyte characters",
"homepage": "https://github.com/jonnybarnes/unicode-tools",
"keywords": [
"unicode",
"utf-8"
],
"time": "2013-07-18 15:32:42"
},
{
"name": "jonnybarnes/webmentions-parser",
"version": "dev-master",
@ -5351,7 +5307,6 @@
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"jonnybarnes/unicode-tools": 20,
"jonnybarnes/indieweb": 20,
"jonnybarnes/webmentions-parser": 20
},