Ver Fonte

Be more strict when matching an Org table

* lisp/org.el (org-at-table-p): Do not allow "+" character at the
  beginning of a table row.
Nicolas Goaziou há 10 anos atrás
pai
commit
1cc8cdc49e
1 ficheiros alterados com 3 adições e 1 exclusões
  1. 3 1
      lisp/org.el

+ 3 - 1
lisp/org.el

@@ -4499,7 +4499,9 @@ Normal means, no org-mode-specific context."
 If TABLE-TYPE is non-nil, also check for table.el-type tables.
 If `org-enable-table-editor' is nil, return nil unconditionally."
   (and org-enable-table-editor
-       (save-excursion (beginning-of-line) (looking-at "[ \t]*[|+]"))
+       (save-excursion
+	 (beginning-of-line)
+	 (org-looking-at-p (if table-type "[ \t]*[|+]" "[ \t]*|")))
        (let ((element (org-element-lineage (org-element-at-point) '(table) t)))
 	 (and element
 	      (or table-type (eq (org-element-property :type element) 'org))))))