New markdown prettifier

* eldoc-box.el (eldoc-box-buffer-hook): Add new prettifier.
(eldoc-box--remove-noise-chars): Remove carriage returns.
This commit is contained in:
Yuan Fu 2023-03-31 12:01:36 -07:00
parent d1b8cb5066
commit 11535ac497
No known key found for this signature in database
GPG Key ID: 56E19BC57664A442

View File

@ -177,6 +177,7 @@ It will be passes with two arguments: WIDTH and HEIGHT of the childframe.")
(defvar eldoc-box-buffer-hook '(eldoc-box--prettify-markdown-separator (defvar eldoc-box-buffer-hook '(eldoc-box--prettify-markdown-separator
eldoc-box--replace-en-space eldoc-box--replace-en-space
eldoc-box--remove-linked-images eldoc-box--remove-linked-images
eldoc-box--remove-noise-chars
eldoc-box--fontify-html eldoc-box--fontify-html
eldoc-box--condense-large-newline-gaps) eldoc-box--condense-large-newline-gaps)
"Hook run after buffer for doc is setup. "Hook run after buffer for doc is setup.
@ -705,6 +706,13 @@ height."
nil t) nil t)
(replace-match "")))) (replace-match ""))))
(defun eldoc-box--remove-noise-chars ()
"Remove some noise characters like carriage return."
(save-excursion
(goto-char (point-min))
(while (search-forward "\r" nil t)
(replace-match ""))))
(defun eldoc-box--fontify-html () (defun eldoc-box--fontify-html ()
"Fontify HTML tags and special entities." "Fontify HTML tags and special entities."
(save-excursion (save-excursion