]> git.mxchange.org Git - friendica.git/commitdiff
diaspora markdown changes, parse_url format change
authorFriendika <info@friendika.com>
Tue, 20 Sep 2011 22:23:36 +0000 (15:23 -0700)
committerFriendika <info@friendika.com>
Tue, 20 Sep 2011 22:23:36 +0000 (15:23 -0700)
boot.php
include/bb2diaspora.php
library/markdown.php
view/theme/dispy/jot-header.tpl

index b38855f358b7459267c6e5c7a27c818567958d5b..61384a4276f72fdf5a5dd5ec153dc791b7f6977b 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -7,7 +7,7 @@ require_once('include/text.php');
 require_once("include/pgettext.php");
 
 
-define ( 'FRIENDIKA_VERSION',      '2.3.1109' );
+define ( 'FRIENDIKA_VERSION',      '2.3.1110' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1091      );
 
index 5b240bdd24143b0e1fe82064459efa91fba79c1f..3d6408bcfe134b7e66603512c9b1872764fc48b6 100644 (file)
@@ -3,30 +3,14 @@
 require_once("include/oembed.php");
 require_once('include/event.php');
 
-
-
+require_once('library/markdown.php');
+require_once('include/html2bbcode.php');
 
 function diaspora2bb($s) {
 
-       // bug #127
-       $s = preg_replace('/\[(.+?)\]\((.+?)[^\\\]_(.+?)\)/','[$1]($2\\_$3)',$s);
-
-
-       $s = str_replace(array('\\**','\\__','\\*','\\_'), array('-^doublestar^-','-^doublescore-^','-^star^-','-^score^-'),$s);
-       $s = preg_replace("/\*\*\*(.+?)\*\*\*/", '[b][i]$1[/i][/b]', $s);
-       $s = preg_replace("/\_\_\_(.+?)\_\_\_/", '[b][i]$1[/i][/b]', $s);
-       $s = preg_replace("/\*\*(.+?)\*\*/", '[b]$1[/b]', $s);
-       $s = preg_replace("/\_\_(.+?)\_\_/", '[b]$1[/b]', $s);
-       $s = preg_replace("/\*(.+?)\*/", '[i]$1[/i]', $s);
-       $s = preg_replace("/\_(.+?)\_/", '[i]$1[/i]', $s);
-
-       $s = str_replace(array('-^doublestar^-','-^doublescore-^','-^star^-','-^score^-'), array('**','__','*','_'), $s);
-       $s = preg_replace('/\!\[(.+?)\]\((.+?)\)/','[img]$2[/img]',$s);
-       $s = preg_replace('/\[(.+?)\]\((.+?)\)/','[url=$2]$1[/url]',$s);
        $s = preg_replace('/\@\{(.+?)\; (.+?)\@(.+?)\}/','@[url=https://$3/u/$2]$1[/url]',$s);
-
-
-       $s = escape_tags($s);
+       $s = Markdown($s);
+       $s = html2bbcode($s);
        return $s;
 
 }
@@ -188,8 +172,7 @@ function bb2diaspora($Text,$preserve_nl = false) {
 
        $Text = preg_replace("/\<(.*?)(src|href)=(.*?)\&amp\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text);
 
-       $Text = preg_replace('/\[(.*?)\\\\_(.*?)\]\((.*?)\)/ism','[$1_$2]($3)',$Text);
-       $Text = preg_replace('/\[(.*?)\\\\\*(.*?)\]\((.*?)\)/ism','[$1*$2]($3)',$Text);
+       $Text = preg_replace('/\[(.*?)\]\((.*?)\\\\_(.*?)\)/ism','[$1]($2_$3)',$Text);
        
        call_hooks('bb2diaspora',$Text);
 
index d51dceecaf0ac796b4b1cceb472576a85d93aefd..343153186af563e76dfd60726b986ac349b57f7e 100644 (file)
@@ -1528,7 +1528,7 @@ class Markdown_Parser {
                                |
                                        <\?.*?\?> | <%.*?%>             # processing instruction
                                |
-                                       <[/!$]?[-a-zA-Z0-9:]+   # regular tags
+                                       <[/!$]?[-a-zA-Z0-9:_]+  # regular tags
                                        (?>
                                                \s
                                                (?>[^"\'>]+|"[^"]*"|\'[^\']*\')*
index 1555950561a56e94d0cd30105949c16a4fc085c9..dd07dc318aee3b6f346167b1210be8b44f5af418 100644 (file)
@@ -163,7 +163,7 @@ function initEditor(cb) {
                if(reply && reply.length) {
                        reply = bin2hex(reply);
                        $('#profile-rotator').show();
-                       $.get('parse_url?url=' + reply, function(data) {
+                       $.get('parse_url?binurl=' + reply, function(data) {
                                tinyMCE.execCommand('mceInsertRawHTML',false,data);
                                $('#profile-rotator').hide();
                        });