Function: cider-docview-fontify-emphasis

cider-docview-fontify-emphasis is a byte-compiled function defined in cider-doc.el.

Signature

(cider-docview-fontify-emphasis BUFFER)

Documentation

Font lock BUFFER emphasized text and remove markdown characters.

One '*' represents emphasis, multiple '**'s represent strong emphasis. Preformatted code text blocks are ignored.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-doc.el
(defun cider-docview-fontify-emphasis (buffer)
  "Font lock BUFFER emphasized text and remove markdown characters.
One '*' represents emphasis, multiple '**'s represent strong emphasis.
Preformatted code text blocks are ignored."
  (with-current-buffer buffer
    (save-excursion
      (while (search-forward-regexp "\\(*+\\)\\(\\w\\)" nil t)
        (if (eq (get-text-property (point) 'block) 'code)
            (forward-char)
          (progn
            (replace-match "\\2")
            (let ((beg (1- (point)))
                  (face (if (> (length (match-string 1)) 1)
                            'cider-docview-strong-face
                          'cider-docview-emphasis-face)))
              (when (search-forward-regexp "\\(\\w\\)\\*+" (line-end-position) t)
                (replace-match "\\1")
                (put-text-property beg (point) 'font-lock-face face)))))))))