]> lifelog.hopto.org Git - LifeLog.git/commitdiff
Layout fixes.
authorWill Budic <redacted>
Thu, 21 Sep 2023 06:46:25 +0000 (16:46 +1000)
committerWill Budic <redacted>
Thu, 21 Sep 2023 06:46:25 +0000 (16:46 +1000)
htdocs/cgi-bin/index.cgi
htdocs/cgi-bin/index.cnf
htdocs/cgi-bin/system/modules/CNFParser.pm
htdocs/cgi-bin/system/modules/MarkdownPlugin.pm

index 812e4d1168b42c9e66b90240c44a1ea7ff8d0f61..29b12207028332217efa406c3bfa5636be7e8f93 100755 (executable)
@@ -6,9 +6,6 @@
 # Which then can be moved to a respective include file over there.
 # This controller binds and provides to the parser to do its magic thing.
 #
-# Programed by: Will Budic
-# Open Source License -> https://choosealicense.com/licenses/isc/
-#
 use v5.30;
 use strict;
 use warnings;
index 4ca5f38b780f01ca7abe11cff2ada266471cfcd5..b79f4a40785512f0e6b784047362ecc130228e42 100644 (file)
         text-align: left;
         padding-bottom: 10px;
         margin-right: 30px;
-        margin-top:5px;
+        margin-top: 15px;
     }
 
     .cnf h1{
         text-align: left;
         padding-bottom: 20px;
         margin-right: 30px;
+        margin-top: 15px;
     }
 
     .perl h1{
@@ -309,6 +310,7 @@ function loadDocResult(content){
             <div<
                 id="feeds"
                 class="rz"
+                style ="margin: 5px; visibility:hidden"
                 [#[ RSS Here ]#]
             >div>
             <a<
index a304072194581494a6c4de43c4827a58a68e6c3a..752d7c198f3370f4a1164e8bf4c7c7c4ab2c9202 100644 (file)
@@ -713,7 +713,6 @@ sub parse {  my ($self, $cnf_file, $content, $del_keys) = @_;
                                     $anons ->{$name} = $line if $line
                                 }else{
                                   if($line and not $self->{$name}){# Not allowed to overwrite constant.
-
                                     $self->{$name} = $line;
                                   }else{
                                         warn "Skipping and keeping previously set constance -> [$name] the new value ".
index d1408b04f98e61b6668d751014647dd7e7b67733..eb08f56c6cc74ea38a060d88a0e40ea51bbd8b13 100644 (file)
@@ -2,13 +2,6 @@
 # This is an Ambitious Markup Script converter from  MD scripts to HTML. Every programers nightmare.
 # MD scripts can thus be placed in PerlCNF properties for further processing by this plugin.
 # Processing of these is placed in the data parsers data.
-# Programed by  : Will Budic
-# Notice - About this source file, it has been copied and usually placed in a local directory, outside of its project.
-# So it could not be the actual or current version, can vary or has been modiefied for what ever purpose in another project.
-# Please leave source of origin in this file for future references.
-# Source of Origin : https://github.com/wbudic/PerlCNF.git
-# Documentation : Specifications_For_CNF_ReadMe.md
-# Open Source Code License -> https://choosealicense.com/licenses/isc/
 #
 package MarkdownPlugin;
 
@@ -21,7 +14,7 @@ use feature qw(signatures);
 use Clone qw(clone);
 ##no critic ControlStructures::ProhibitMutatingListFunctions
 
-use constant VERSION => '1.0';
+use constant VERSION => '1.1';
 
 our $TAB = ' 'x4;
 our $PARSER;
@@ -233,6 +226,7 @@ try{
             if($list_root){ # Has been previously gathered and hasn't been buffered yet.
                $buff .= $list_root -> toString();
                undef $list_root;
+               undef $list_item;
             }
             $buff .= qq(<$h>$title</$h><a name=").scalar(@titels)."\"></a>\n"
         }
@@ -301,6 +295,7 @@ try{
             }
         }
         elsif($ln =~ /^(\s*)(.*)/ && length($2)>0){
+            my $spc = length($1);
             my $v = $2;
             if($code){
                  my $spc=$1; $list_end =0;
@@ -401,12 +396,38 @@ try{
                     $para   .= $bqte; $bqte_nested=0;
                     undef $bqte;
                 }
-                $para .= ${style($2)}."\n"
+
+                if($list_root && $spc>0){
+                    my $new = HTMLListItem -> new('dt', ${style($v)}, $spc);
+                    if($spc>$nplen){
+                        $list_item -> add($new);
+                        $list_item = $new;
+                        $nplen = $spc;
+                    }else{
+                        my $isEq = $list_item->{spc} == $spc;
+                        while($list_item->{spc} >= $spc && $list_item -> parent()){
+                            $list_item = $list_item -> parent();
+                            last if $isEq
+                        }
+                        $list_item = $list_root if  !$list_item;
+                        $list_item -> add($new);
+                    $list_item = $new;
+                    }
+                    $list_end = 0;
+                }else{
+                    $para .= ${style($v)}."\n"
+                }
             }
         }else{
             if($list_root && ++$list_end>1){
                $buff .= $list_root -> toString();
+               if($para){
+                    $buff .= qq(<p>$para</p>\n);
+                    $list_end=0;
+                    $para  =""
+               }
                undef $list_root;
+               undef $list_item;
             }
             elsif($para){
                 if($bqte){
@@ -421,7 +442,7 @@ try{
                elsif($code){
                     $buff .= $para;
                }else{
-                    $buff .= qq(<p>$para</p><br>\n);
+                    $buff .= qq(<p>$para</p>\n);
                }
                $para=""
             }
@@ -570,13 +591,13 @@ if(!$oo && !$cc){
 
     $body =~ m/ ^([\[<\#\*\[<]+)  (.*?) ([\]>\#\*\]>]+)$  /gmx;
     if($1&&$2&&$3){
-      $oo=$1;
+      $oo   = $1;
       $body = $2;
-      $cc=$3;
-      $oo =~ s/</&#60;/g;
-      $oo =~ s/>/&#62;/g;
-      $cc =~ s/</&#60;/g;
-      $cc =~ s/>/&#62;/g;
+      $cc   = $3;
+      $oo   =~ s/</&#60;/g;
+      $oo   =~ s/>/&#62;/g;
+      $cc   =~ s/</&#60;/g;
+      $cc   =~ s/>/&#62;/g;
       $body =~ s/</&#60;/g;
       $body =~ s/>/&#62;/g;
       return "$spc<span ".C_B.">$oo</span><span ".C_PV.">$body</span>><span ".C_B.">$cc</span>";