]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Fix undefined thumbnail in OpenGraph headers (#1363)
authorArthurHoaro <arthur@hoa.ro>
Tue, 10 Sep 2019 18:25:19 +0000 (20:25 +0200)
committerGitHub <noreply@github.com>
Tue, 10 Sep 2019 18:25:19 +0000 (20:25 +0200)
Fix undefined thumbnail in OpenGraph headers

assets/default/scss/shaarli.scss
plugins/markdown/markdown.php
tests/plugins/PluginMarkdownTest.php
yarn.lock

index 61e382b69dc6837111df8a04de9d4bd0ca5eafcc..cd5dd9e6d012af1258609279d77347501c569ef4 100644 (file)
@@ -1436,6 +1436,8 @@ form {
   -webkit-transition: opacity 500ms ease-in-out;
   -moz-transition: opacity 500ms ease-in-out;
   -o-transition: opacity 500ms ease-in-out;
+  min-width: 1px;
+  min-height: 1px;
 
   &.b-loaded {
     opacity: 1;
index 628970d626ff4064b0daecc0b97fd40c855d3551..f6f66cc561fc0c697e06c1b2776c5d09510b299b 100644 (file)
@@ -259,7 +259,7 @@ function reverse_space2nbsp($description)
 
 function reverse_feed_permalink($description)
 {
-    return preg_replace('@&#8212; <a href="([^"]+)" title="[^"]+">(\w+)</a>$@im', '&#8212; [$2]($1)', $description);
+    return preg_replace('@&#8212; <a href="([^"]+)" title="[^"]+">([^<]+)</a>$@im', '&#8212; [$2]($1)', $description);
 }
 
 /**
index 9ddbc558f3d50294fe286322877d099c30ce0b4a..15fa9ba598672d27f46ec989c7c4fd63ccf1c8a7 100644 (file)
@@ -156,6 +156,16 @@ class PluginMarkdownTest extends \PHPUnit\Framework\TestCase
         $this->assertEquals($expected, $processedText);
     }
 
+    public function testReverseFeedDirectLink()
+    {
+        $text = 'Description... ';
+        $text .= '&#8212; <a href="http://domain.tld/?0oc_VQ" title="Direct link">Direct link</a>';
+        $expected = 'Description... &#8212; [Direct link](http://domain.tld/?0oc_VQ)';
+        $processedText = reverse_feed_permalink($text);
+
+        $this->assertEquals($expected, $processedText);
+    }
+
     public function testReverseLastFeedPermalink()
     {
         $text = 'Description... ';
index 1aa94f4230f702d08da2dc9b6d520f0b8b2b6945..7e627ab1d3cee1dc940d4e75353f4414a09a783b 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
@@ -3428,9 +3428,9 @@ lodash.uniq@^4.5.0:
   integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
 
 lodash@^4.0.0, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.3.0, lodash@~4.17.10:
-  version "4.17.11"
-  resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
-  integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
+  version "4.17.15"
+  resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
+  integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
 
 longest@^1.0.1:
   version "1.0.1"