Fix: Images Alignement - + autres fix

This commit is contained in:
Cyrille L 2022-04-11 18:06:38 +02:00
parent 14196f870d
commit 64c30a31a5
7 changed files with 54 additions and 55 deletions

View File

@ -1,5 +1,5 @@
Package: egsl
Version: 0.0.12
Version: 0.0.13
Section: custom
Priority: optional
Architecture: all

View File

@ -1,5 +1,5 @@
#!/bin/bash
# Version: 0.0.12
# Version: 0.0.13
# file: gsl
# Folder: /usr/local/bin
# By echolib
@ -11,18 +11,18 @@
if__command() {
! [[ `command -v $1` ]] \
&& echo -e "$I_Red Missing $1 command" \
&& exit 1
&& exit
}
gsl__if_file() {
if ! [[ -f "$1" ]];then
echo "! Missing file: $1"
exit 1
exit
fi
case "$2" in
source)
source "$1" || exit 1
source "$1" || exit
;;
read)
cat "$1"
@ -190,7 +190,7 @@ gsl__create_ff
gsl__find_domain
gsl__if_file "$gsl_dir_scripts/gsl__auth_manager" source
gsl__authors_list check || exit 1
gsl__authors_list check || exit
gsl__if_file "$gsl_dir_scripts/gsl__post_checkers" source
gsl__if_file "$gsl_dir_scripts/gsl__post_manager" source
gsl__if_file "$gsl_dir_scripts/gsl__db_manager" source
@ -205,7 +205,7 @@ case "$1" in
edit|-E)
! [[ "$2" ]] \
&& echo "! Missing argument: post [FILE]" \
&& exit 1
&& exit
gsl__if_file "$2" post
if ! [[ "$EDITOR" ]];then
@ -257,7 +257,7 @@ case "$1" in
db)
! [[ "$2" ]] \
&& echo "! Missing argument: post [FILE]" \
&& exit 1
&& exit
gsl__if_file "$2" post
[[ -f "$gsl_dir_db/$gsl_this_post.db" ]] \
@ -358,13 +358,13 @@ case "$1" in
;;
*)
echo "! Bad Argument: $2"
exit 1
exit
;;
esac
! [[ "$3" ]] \
&& echo "! Missing argument: post [FILE]" \
&& exit 1
&& exit
gsl__if_file "$3" post
@ -389,7 +389,7 @@ case "$1" in
www)
! [[ "$2" ]] \
&& echo "! Missing argument: OPT=add/remove" \
&& exit 1
&& exit
if__command rsync
gsl_www_act="$2"
@ -402,13 +402,13 @@ case "$1" in
;;
*)
echo "! Bad argument: $2 ? OPT=add/remove"
exit 1
exit
;;
esac
! [[ "$3" ]] \
&& echo "! Missing argument: post [FILE]/all" \
&& exit 1
&& exit
case "$3" in
all)
@ -419,7 +419,7 @@ case "$1" in
;;
*)
echo "# Abandon"
exit 1
exit
;;
esac
;;

View File

@ -112,7 +112,6 @@ do
sed -i "s|$gsl_bold|$gsl_html_bold|g" "$2"
;;
esac
fi
done < <(grep -oPn "(?<=$gsl_mark_bold).*?(?=$gsl_mark_bold)" "$2")

View File

@ -226,6 +226,7 @@ if (( "$gsl_count_links" > 0 ));then
"$gsl_log_h_link" \
"Offline:$gsl_url_status ${gsl_post_hf_2:0:40}..." \
"${PWD}/$gsl_post"
# Decomment below if you want the error link avoiding convertion
#gsl_checker_err=true
return
;;

View File

@ -590,12 +590,6 @@ while IFS=: read -r "line_nbr" "this_image"
do
align_image=`awk -F: '{print $3}' <<< "$this_image"`
[[ $align_image ]] \
&& align_image=":$align_image"
echo -ne "\r\033[2K: Converting Image... Line:$line_nbr $this_image"
gsl_html_src="src=\"$gsl_bpic_url/$gsl_post_hf_2\""
gsl_html_alt="alt=\"$gsl_post_hf_3\""
case "$align_image" in
R|r|D|d)
@ -612,9 +606,12 @@ do
;;
esac
gsl_html_src="src=\"$gsl_bpic_url/$gsl_post_hf_2\""
gsl_html_alt="alt=\"$gsl_post_hf_3\""
gsl_html_image="<img $gsl_html_src $gsl_html_class $gsl_html_alt />"
gsl_post_image="$gsl_mark_image:$gsl_post_hf_1$align_image"
sed -i "${line_nbr}s|$gsl_post_image|$gsl_html_image|" "$gsl_tmp_post"
echo -ne "\r\033[2K: Converting Image... Line:$line_nbr $this_image"
sed -i "${line_nbr}s|$this_image|$gsl_html_image|" "$gsl_tmp_post"
done < <(grep -n "$gsl_this_mark" "$gsl_tmp_post")
}
@ -718,6 +715,7 @@ do
gsl__make_a11y_add_space
unset gsl_start_line
fi
gsl_set_space=`expr substr "$gsl_line" 3 1`
gsl_start_line=$gsl_line_nbr
unset gsl_stop_line

View File

@ -60,6 +60,7 @@ do
"$gsl_post_type ; $gsl_post has changed" \
"$gsl_srv_wip_page"
fi
if [[ -f "$gsl_file_db_post" ]];then
rm -f "$gsl_file_db_post" && \
gsl__logs_print \
@ -215,9 +216,9 @@ fi
gsl__check_nbr_posts() {
gsl_nbr_posts=`ls -1 *.gsl 2>/dev/null | wc -l`
! (( $gsl_nbr_posts >= 1 )) \
(( $gsl_nbr_posts == 0 )) \
&& echo "! No Posts found with .gsl extension" \
&& exit 1
&& exit
}
#======================================================================

View File

@ -41,7 +41,7 @@ find . -maxdepth 1 -not -type d -type f \
&& exit $gsl_nbr_domains
(( $gsl_nbr_domains == 0 )) \
&& echo "! No registred domain here: change or set folder. See help new" \
&& exit 1
&& exit
gsl_find_domain=`
find . -maxdepth 1 -not -type d -type f \
@ -63,7 +63,7 @@ gsl_this_conf_domain=`grep "$1" "$gsl_file_db_domains"`
! [[ "$gsl_this_conf_domain" ]] \
&& echo "! Domain Not found: $1" \
&& exit 1
&& exit
gsl_dir_domain_tpl="$gsl_this_conf_domain/templates"
gsl_dir_domain_files="$gsl_this_conf_domain/files"