1
0
Fork 0

- [fediverse] rendered correctly ordered list;

- fixed indentation of configure.ac;
- removed useless command in Makefile.
This commit is contained in:
cage 2024-05-01 12:36:00 +02:00
parent 2cf9b31a4b
commit 82bdf5c538
6 changed files with 47 additions and 16 deletions

View File

@ -95,12 +95,12 @@ data/scripts/welcome-bot.lisp
dist_man1_MANS = doc/tinmop.man
$(PACKAGE): $(CONF_PATH_FILE) *.asd src/*
cd $$(dirname $$($(LISP_COMPILER) --noinform --eval "(format t \"~a\" *core-pathname*)" --eval "(sb-ext:quit)")) && \
$(LISP_COMPILER) \
--eval "(push \"$$(pwd)/\" asdf:*central-registry*)" \
--eval "(asdf:make '$(PACKAGE) :build-pathname \"../$(PACKAGE)\")" \
--eval "(uiop:quit)"
mv src/tinmop $(PACKAGE)
$(CONF_PATH_FILE):
grep "^;" $(CONF_PATH_FILE_IN) > $(CONF_PATH_FILE)
echo -e "(in-package :config)\n" >> $(CONF_PATH_FILE);

View File

@ -1117,12 +1117,12 @@ uninstall-man: uninstall-man1
$(PACKAGE): $(CONF_PATH_FILE) *.asd src/*
cd $$(dirname $$($(LISP_COMPILER) --noinform --eval "(format t \"~a\" *core-pathname*)" --eval "(sb-ext:quit)")) && \
$(LISP_COMPILER) \
--eval "(push \"$$(pwd)/\" asdf:*central-registry*)" \
--eval "(asdf:make '$(PACKAGE) :build-pathname \"../$(PACKAGE)\")" \
--eval "(uiop:quit)"
mv src/tinmop $(PACKAGE)
$(CONF_PATH_FILE):
grep "^;" $(CONF_PATH_FILE_IN) > $(CONF_PATH_FILE)
echo -e "(in-package :config)\n" >> $(CONF_PATH_FILE);

2
configure vendored
View File

@ -8132,7 +8132,7 @@ fi
ac_header= ac_cache=
ac_header= ac_cache=
for ac_item in $ac_header_c_list
do
if test $ac_cache; then

View File

@ -167,7 +167,7 @@ AC_CHECK_LIB([turbojpeg], [tjInitDecompress], [], AC_MSG_ERROR([Can not find lib
dnl check headers
AC_CHECK_HEADER([turbojpeg.h], [], [Can not find libturbojpeg0 headers file.], [])
AC_CHECK_HEADER([turbojpeg.h], [], [Can not find libturbojpeg0 headers file.], [])
AC_CONFIG_FILES([Makefile quick_quicklisp.sh po/Makefile.in src/config.lisp.in])

View File

@ -17,21 +17,25 @@
(in-package :html-utils)
(define-constant +tag-link+ "a" :test #'string=)
(define-constant +tag-link+ "a" :test #'string=)
(define-constant +tag-break+ "br" :test #'string=)
(define-constant +tag-break+ "br" :test #'string=)
(define-constant +tag-paragraph+ "p" :test #'string=)
(define-constant +tag-paragraph+ "p" :test #'string=)
(define-constant +tag-list-item+ "li" :test #'string=)
(define-constant +tag-ordered-list+ "ol" :test #'string=)
(define-constant +tag-div+ "div" :test #'string=)
(define-constant +tag-unordered-list+ "ul" :test #'string=)
(define-constant +tag-blockquote+ "blockquote" :test #'string=)
(define-constant +tag-list-item+ "li" :test #'string=)
(define-constant +attribute-url+ "href" :test #'string=)
(define-constant +tag-div+ "div" :test #'string=)
(define-constant +http-scheme+ "http" :test #'string=)
(define-constant +tag-blockquote+ "blockquote" :test #'string=)
(define-constant +attribute-url+ "href" :test #'string=)
(define-constant +http-scheme+ "http" :test #'string=)
(defun http-link-iri-p (iri)
(conditions:with-default-on-error (nil)
@ -106,6 +110,12 @@
(defparameter *quote-level* 0)
(defparameter *ordered-list* nil)
(defparameter *unordered-list* nil)
(defparameter *ordered-list-item-number* 0)
(defun html->text (html &key
(add-link-footnotes t) (body-footnotes-separator "")
(quote-prefix "> ") (list-item-prefix "* "))
@ -166,11 +176,31 @@ Some convenience functions are provided to works with these structures.
(princ *prefix-text-line* body-stream)))
(descend-children node)
(format body-stream "~%")))
((tag= +tag-unordered-list+ node)
(let ((*ordered-list* nil)
(*unordered-list* t))
(descend-children node)))
((tag= +tag-ordered-list+ node)
(let ((*ordered-list* t)
(*unordered-list* nil)
(*ordered-list-item-number* 0))
(descend-children node)))
((tag= +tag-list-item+ node)
(let ((*block-tag* nil))
(format body-stream list-item-prefix)
(descend-children node)
(format body-stream "~%")))
(cond
(*unordered-list*
(format body-stream list-item-prefix)
(descend-children node)
(format body-stream "~%"))
(*ordered-list*
(incf *ordered-list-item-number*)
(format body-stream "~a." *ordered-list-item-number*)
(descend-children node)
(format body-stream "~%"))
(t
(format body-stream "unknown list type ")
(descend-children node)
(format body-stream "~%")))))
((tag= +tag-blockquote+ node)
(let ((*prefix-text-line* quote-prefix)
(*quote-level* (1+ *quote-level*))

View File

@ -531,7 +531,8 @@ list of strings (the text lines)."
(win-close window)))
(defun make-dialog (parent title message style
&optional (buttons nil)
&optional
(buttons nil)
(append-ok-button t))
(let* ((lines (text-utils:split-lines message))
(actual-buttons (if append-ok-button