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.
This commit is contained in:
Nicolas Goaziou 2021-07-28 10:32:29 +02:00
parent 40a20136d3
commit af0fcb6833
2 changed files with 8 additions and 7 deletions

View File

@ -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)))

View File

@ -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