1
0
Fork 0

Compare commits

...

4 Commits

5 changed files with 58 additions and 37 deletions

View File

@ -266,8 +266,6 @@
(set-option-variable options :gemini-gui-server *rpc-server-mode*)
(set-option-variable options :gemini-gui *rpc-client-mode*)
(set-option-variable options :folder *start-folder*)
(when (string-not-empty-p *start-folder*)
(setf *start-folder* (db:add-folder-prefix *start-folder*)))
(set-option-variable options :open-net-address *net-address*)
(set-option-variable options :timeline *start-timeline*)
(set-option-variable options :reset-timeline-pagination *reset-timeline-pagination*)

View File

@ -123,7 +123,6 @@
(client-configuration:config-icons-scaling))))
(defun load-icons ()
(let ((nodgui:*use-tk-for-decoding-png* t))
(setf *search* (load-icon +search+))
(setf *back* (load-icon +back+))
(setf *open-iri* (load-icon +go+))
@ -149,4 +148,4 @@
(setf *profile* (load-icon +profile+))
(setf *profile-disabled* (disable-icon +profile+))
(setf *toc* (load-icon +toc+))
(setf *toc-disabled* (disable-icon +toc+))))
(setf *toc-disabled* (disable-icon +toc+)))

View File

@ -116,6 +116,24 @@
(defparameter *ordered-list-item-number* 0)
(defun append-footnote-reference (text reference-number)
(strcat text
(format nil
"~a~a"
#\ZERO_WIDTH_SPACE
(number->superscripts reference-number))))
(defun footnote-reference-re (&key (enforce-end-string t))
(format nil
"~a[~a]+~@[$~]"
#\ZERO_WIDTH_SPACE
+digits-superscripts+
enforce-end-string))
(let ((scanner (cl-ppcre:create-scanner (footnote-reference-re))))
(defun strip-footnote-reference (word)
(cl-ppcre:regex-replace scanner word "")))
(defun html->text (html &key
(add-link-footnotes t) (body-footnotes-separator "")
(quote-prefix "> ") (list-item-prefix "* "))
@ -160,10 +178,8 @@ Some convenience functions are provided to works with these structures.
link-count))
(descend-children node)
(when add-link-footnotes
(format body-stream
"~a~a "
#\ZERO_WIDTH_SPACE
(number->superscripts link-count)))))
(write-string (append-footnote-reference "" link-count)
body-stream))))
((tag= +tag-break+ node)
(let ((*block-tag* nil))
(format body-stream "~%")

View File

@ -37,8 +37,10 @@
first-mention)))))
(defun line-find-all-usernames (message-line)
(let ((words (split-words message-line)))
(mapcar (lambda (a) (subseq a (length +mention-prefix+))) ; remove the @
(let ((words (split-words message-line))
(mention-prefix-length (length +mention-prefix+)))
(mapcar (lambda (a)
(html-utils:strip-footnote-reference (subseq a mention-prefix-length))) ; remove the @
(remove-if-not (lambda (word)
(cl-ppcre:scan (strcat "^" +mention-prefix+) word))
words))))
@ -63,7 +65,9 @@
is found as key in the alist `usernames-table'"
(let ((results text-line))
(loop for (local-mention . actual-mention) in usernames-table do
(let ((local-mention-re (strcat "(\\s|^)" local-mention)))
(let ((local-mention-re (strcat "(\\s|^)"
local-mention
(html-utils:footnote-reference-re :enforce-end-string nil))))
(setf results (regex-replace-all local-mention-re
results
(strcat " " actual-mention)))))

View File

@ -453,6 +453,7 @@
(:export
:+float-regexp+
:+integer-regexp+
:+digits-superscripts+
:*blanks*
:uchar-length
:starts-with-prefix-p
@ -526,6 +527,9 @@
:find-tag
:position-tag
:node->link
:append-footnote-reference
:strip-footnote-reference
:footnote-reference-re
:html->text))
(defpackage :resources-utils