]> bicyclesonthemoon.info Git - ott/post/commitdiff
Preview is now ready. v1.0.3
authorb <rowerynaksiezycu@gmail.com>
Sun, 3 Sep 2023 20:47:38 +0000 (20:47 +0000)
committerb <rowerynaksiezycu@gmail.com>
Sun, 3 Sep 2023 20:47:38 +0000 (20:47 +0000)
post_common.1.pm
preview.1.pl
settings.txt

index b32da66e1b4bc4521b01bf1e5b62428c30c8ead2..9658d3ebdeb9aec87620220b7b527c541976792e 100644 (file)
@@ -41,7 +41,8 @@ use botm_common (
        'system_encoded',
        'write_data_file',
        'write_postdata_file',
-       'html_entity_encode_dec'
+       'html_entity_encode_dec',
+       'merge_url'
 );
 
 ###PERL_DEFAULT_PASSWORD: use constant DEFAULT_PASSWORD => 'password';
@@ -1683,16 +1684,18 @@ sub bbcode_to_html {
                # [/name]
                # [name=value]
                # [name="value"]
-               if($bbcode =~ m/(\[(\/?)([a-z]+|\*)(=(([^\[\]]*)|("[^"]*")))?\])/g) {
+               if($bbcode =~ m/\[(\/?)([a-z]+|\*)(=(([^\[\]]*)|("[^"]*")))?\]/g) {
                        # assign detected parts:
-                       $tag = $1;
-                       $tag_end = $2;
-                       $tag_name = $3;
-                       $tag_value = $5;
+                       $tag = $&;
+                       $tag_end = $1;
+                       $tag_name = $2;
+                       $tag_value = $4;
                        # text before the tag:
-                       $text = substr($bbcode, 0, pos($bbcode) - length($tag));
+                       # $text = substr($bbcode, 0, pos($bbcode) - length($tag));
+                       $text = $`;
                        # cut off already processed part:
-                       $bbcode = substr ($bbcode, pos ($bbcode));
+                       # $bbcode = substr ($bbcode, pos ($bbcode));
+                       $bbcode = $';
                }
                # no tag found, only text left
                else {
@@ -2229,10 +2232,10 @@ sub bbcode_to_html {
                        # convert smilies
                        if (($post->{'smilies'}) and ($tag_name !~ /^((code)|(img))$/)) {
                                if ($cmd_options->{'post-style'} eq 'phpbb') {
-                                       $text =~ s/(^|[ \t])((:([D\(\)o\?xP\|]|(((shock)|(lol)|(oops)|(cry)|(evil)|(twisted)|(roll)|(wink)|(idea)|(arrow)|(mrgreen)|[!\?]):)))|(8-\))|(;\)))($|[ \t])/' <img title="'.BBCODE_SMILEY_TITLE->{$2}.'" alt="'.$2.'" src="'.BBCODE_SMILEY_FILE->{$2}.'" \/> '/gme;
+                                       $text =~ s/(^|[ \t])((:([D\(\)o\?xP\|]|(((shock)|(lol)|(oops)|(cry)|(evil)|(twisted)|(roll)|(wink)|(idea)|(arrow)|(mrgreen)|[!\?]):)))|(8-\))|(;\)))($|[ \t])/' <img title="'.BBCODE_SMILEY_TITLE->{$2}.'" alt="'.$2.'" src="'.merge_url($cmd_options->{'smiley-url'},BBCODE_SMILEY_FILE->{$2}).'" \/> '/gme;
                                }
                                else {
-                                       $text =~ s/(^|[ \t])((:([D\(\)o\?xP\|]|(((shock)|(lol)|(oops)|(cry)|(evil)|(twisted)|(roll)|(wink)|(idea)|(arrow)|(mrgreen)|[!\?]):)))|(8-\))|(;\)))($|[ \t])/' <img title="'.BBCODE_SMILEY_TITLE->{$2}.'" alt="'.$2.'" src="'.BBCODE_SMILEY_FILE->{$2}.'"> '/gme;
+                                       $text =~ s/(^|[ \t])((:([D\(\)o\?xP\|]|(((shock)|(lol)|(oops)|(cry)|(evil)|(twisted)|(roll)|(wink)|(idea)|(arrow)|(mrgreen)|[!\?]):)))|(8-\))|(;\)))($|[ \t])/' <img title="'.BBCODE_SMILEY_TITLE->{$2}.'" alt="'.$2.'" src="'.merge_url($cmd_options->{'smiley-url'},BBCODE_SMILEY_FILE->{$2}).'"> '/gme;
                                }
                        }
                        
index 3335debe58cfdf0b7e25ec04898ea2665163ec90..826f9669147b2287e6a97597e8d91b99042f0256 100644 (file)
@@ -66,9 +66,9 @@ use constant HELP_TEXT =>
        "       --smiley-url=SMILEY_URL\n".
        "       --css-url=CSS_URL\n".
        "       --inline-css\n".
-       "       --post-style=\n".
-       "                    phpbb\n".
+       "       --post-style=phpbb\n".
        "                    botm\n".
+       "                    bsta\n".
        "\n".
        "  -q,  --quiet\n".
        "  -v,  --verbose\n".
index f14c7a3e98cc6fd0593de2f2c92bd0c4365b06fd..8731502a284c2b53731cc7d74597c4d462bd1b0f 100644 (file)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-_version: 1.0.2
+_version: 1.0.3
 
 _PERL_STR: '@_ESCAPE($0,')'
 _SHEBANG: #!$0