diff --git a/eldoc-box.el b/eldoc-box.el
index a223a12..58d65fc 100644
--- a/eldoc-box.el
+++ b/eldoc-box.el
@@ -672,8 +672,10 @@ height."
(save-excursion
(goto-char (point-min))
(while (re-search-forward
- (rx (>= 2 (or "\n" (seq "```" (+ (syntax word))) "
"
- (seq bol (+ (or " " "\t" " ")) eol))))
+ (rx (>= 2 (or "\n"
+ (seq bol "```" (* (syntax word)) "\n")
+ (seq bol "
" "\n")
+ (seq bol (+ (or " " "\t" " ")) "\n"))))
nil t)
(if (or (eq (match-beginning 0) (point-min))
(eq (match-end 0) (point-max)))