Browse Source

element: Allow citations in table cells

* lisp/org-element.el (org-element-object-restrictions): Allow
citations in table cells.
* testing/lisp/test-org-element.el (test-org-element/citation-parser):
Add test.  Remove outdated test.
Nicolas Goaziou 3 years ago
parent
commit
af0fcb6833
2 changed files with 8 additions and 7 deletions
  1. 2 2
      lisp/org-element.el
  2. 6 5
      testing/lisp/test-org-element.el

+ 2 - 2
lisp/org-element.el

@@ -372,8 +372,8 @@ Don't modify it, set `org-element-affiliated-keywords' instead.")
       ;; Ignore inline babel call and inline source block as formulas
       ;; are possible.  Also ignore line breaks and statistics
       ;; cookies.
-      (table-cell export-snippet footnote-reference link macro radio-target
-		  target timestamp ,@minimal-set)
+      (table-cell citation export-snippet footnote-reference link macro
+                  radio-target target timestamp ,@minimal-set)
       (table-row table-cell)
       (underline ,@standard-set)
       (verse-block ,@standard-set)))

+ 6 - 5
testing/lisp/test-org-element.el

@@ -528,10 +528,6 @@ Some other text
    (eq 'citation
        (org-test-with-temp-text "[cite:@key]"
 	 (org-element-type (org-element-context)))))
-  (should
-   (eq 'citation
-       (org-test-with-temp-text "[cite:-@key]"
-	 (org-element-type (org-element-context)))))
   (should-not
    (eq 'citation
        (org-test-with-temp-text "[cite:text]"
@@ -582,7 +578,12 @@ Some other text
   (should
    (equal '(" common-suffix")
 	  (org-test-with-temp-text "[cite: @a; common-suffix ]"
-	    (org-element-property :suffix (org-element-context))))))
+	    (org-element-property :suffix (org-element-context)))))
+  ;; Allow citations in a table cell.
+  (should
+   (eq 'citation
+       (org-test-with-temp-text "| <point>[cite:@key] |"
+	 (org-element-type (org-element-context))))))
 
 
 ;;;; Citation Reference