 opinionated and perform this simple task incorrectly (e.g. whitespace in the
 wrong places)."
   (interactive)
-  (let* ((context (org-element-context))
+  (let* ((context (org-element-lineage
+                   (org-element-context)
+                   '(table table-row headline inlinetask item plain-list)
+                   t))
          (type (org-element-type context)))
-    (cond ((when-let (ct (+org--get-context '(item plain-list) context))
-             (setq context ct))
+    (cond ((eq type 'item)
            (let ((marker (org-element-property :bullet context)))
              (pcase direction
                ('below

          (org-table-recalculate t)
        (org-table-align)))

     ((and (org-in-item-p)
           (org-element-property :checkbox
                                 (save-excursion
                                   (org-beginning-of-line)
                                   (backward-char)
                                   (org-element-context))))
      (org-toggle-checkbox))

     ((and (eq type 'headline)

      (org-preview-latex-fragment))

     ((eq type 'link)
      (let ((path (org-element-property :path (org-element-lineage context '(link) t))))
        (if (and path (image-type-from-file-name path))
            (+org/refresh-inline-images)
          (org-open-at-point))))
