]> git.mxchange.org Git - friendica-addons.git/commitdiff
Merge pull request #927 from nupplaphil/task/replace_getClass
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 30 Dec 2019 00:55:44 +0000 (19:55 -0500)
committerGitHub <noreply@github.com>
Mon, 30 Dec 2019 00:55:44 +0000 (19:55 -0500)
[various] CleanUp deprecated methods

markdown/lang/cs/messages.po [new file with mode: 0644]
markdown/lang/cs/strings.php [new file with mode: 0644]
markdown/markdown.php

diff --git a/markdown/lang/cs/messages.po b/markdown/lang/cs/messages.po
new file mode 100644 (file)
index 0000000..3799276
--- /dev/null
@@ -0,0 +1,39 @@
+# ADDON markdown
+# Copyright (C)
+# This file is distributed under the same license as the Friendica markdown addon package.
+# 
+# 
+# Translators:
+# Aditoo, 2019
+# 
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2019-12-26 10:04+0000\n"
+"PO-Revision-Date: 2019-12-27 06:41+0000\n"
+"Last-Translator: Aditoo, 2019\n"
+"Language-Team: Czech (https://www.transifex.com/Friendica/teams/12172/cs/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: cs\n"
+"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
+
+#: markdown.php:32
+msgid "Markdown"
+msgstr "Markdown"
+
+#: markdown.php:33
+msgid "Enable Markdown parsing"
+msgstr ""
+
+#: markdown.php:33
+msgid ""
+"If enabled, self created items will additionally be parsed via Markdown."
+msgstr ""
+
+#: markdown.php:34
+msgid "Save Settings"
+msgstr "Uložit nastavení"
diff --git a/markdown/lang/cs/strings.php b/markdown/lang/cs/strings.php
new file mode 100644 (file)
index 0000000..b9340b9
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+
+if(! function_exists("string_plural_select_cs")) {
+function string_plural_select_cs($n){
+       $n = intval($n);
+       return ($n == 1 && $n % 1 == 0) ? 0 : ($n >= 2 && $n <= 4 && $n % 1 == 0) ? 1: ($n % 1 != 0 ) ? 2 : 3;;
+}}
+;
+$a->strings["Markdown"] = "Markdown";
+$a->strings["Enable Markdown parsing"] = "";
+$a->strings["If enabled, self created items will additionally be parsed via Markdown."] = "";
+$a->strings["Save Settings"] = "Uložit nastavení";
index bd0e022c856575937d836d856aab4b2d2e4e5158..0f667373ab3afb9b0b6105b9f89a8165d1e07208 100644 (file)
@@ -50,11 +50,11 @@ function markdown_post_local_start(App $a, &$request) {
        }
 
        // Elements that shouldn't be parsed
-       $elements = ['code', 'noparse', 'nobb', 'pre'];
+       $elements = ['code', 'noparse', 'nobb', 'pre', 'share', 'url', 'img'];
        foreach ($elements as $element) {
-               $request['body'] = preg_replace_callback("/\[" . $element . "\](.*?)\[\/" . $element . "\]/ism",
-                       function ($match)  use ($element) {
-                               return '[base64' . $element . ']' . base64_encode($match[1]) . '[/base64' . $element . ']';
+               $request['body'] = preg_replace_callback("/\[" . $element . "(.*?)\](.*?)\[\/" . $element . "\]/ism",
+                       function ($match) use ($element) {
+                               return '[' . $element . '-b64' . base64_encode($match[1]) . ']' . base64_encode($match[2]) . '[/b64-' . $element . ']';
                        },
                        $request['body']
                );
@@ -63,9 +63,9 @@ function markdown_post_local_start(App $a, &$request) {
        $request['body'] = Markdown::toBBCode($request['body']);
 
        foreach (array_reverse($elements) as $element) {
-               $request['body'] = preg_replace_callback("/\[base64" . $element . "\](.*?)\[\/base64" . $element . "\]/ism",
-                       function ($match)  use ($element) {
-                               return '[' . $element . ']' . base64_decode($match[1]) . '[/' . $element . ']';
+               $request['body'] = preg_replace_callback("/\[" . $element . "-b64(.*?)\](.*?)\[\/b64-" . $element . "\]/ism",
+                       function ($match) use ($element) {
+                               return '[' . $element . base64_decode($match[1]) . ']' . base64_decode($match[2]) . '[/' . $element . ']';
                        },
                        $request['body']
                );