 (defun fstar--highlight-docstring (str)
   "Highlight STR as an F* docstring."
   (with-temp-buffer
-    (insert (string-trim str))
-    (fstar--highlight-docstring-buffer)
+    (insert str)
+    (fstar--highlight-docstring-region (point-min) (point-max))
     (buffer-string)))
 
 (defun fstar-setup-font-lock ()

       :name name
       :def-start (cons (string-to-number start-r) (string-to-number start-c))
       :def-end (cons (string-to-number end-r) (string-to-number end-c))
       :type type
       :doc doc))))

(defun fstar-subp-json--parse-info (json)
  "Parse info structure from JSON."

      (with-no-warnings (font-lock-fontify-buffer)))
    (buffer-string)))

(defun fstar--highlight-docstring-region (beg end)
  "Highlight BEG..END as an F* docstring."
  (let ((inhibit-read-only t))
    (goto-char beg)
    (while (search-forward "[" end t)
      (let* ((beg (point))
             (end (ignore-errors (backward-char) (forward-sexp) (1- (point))))
             (str (and end (buffer-substring-no-properties beg end))))
        (if (null str)
            (goto-char end)
          (goto-char beg)
          (delete-region beg end)
          (insert (fstar-highlight-string str)))))))
