branch: externals/org commit f58c8003c3c2d432f5619ea94bb50e5b91b72e3a Merge: 0517b73 118da7d Author: Nicolas Goaziou <m...@nicolasgoaziou.fr> Commit: Nicolas Goaziou <m...@nicolasgoaziou.fr>
Merge branch 'maint' --- lisp/org-element.el | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index a2582b8..49a5952 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -3950,13 +3950,24 @@ element it has to parse." ((or (looking-at "[ \t]*|") ;; There is no strict definition of a table.el ;; table. Try to prevent false positive while being - ;; quick. - (let ((rule-regexp "[ \t]*\\+\\(-+\\+\\)+[ \t]*$") + ;; quick. Hence, we consider a table.el table is at + ;; least one rule, any number of data lines + ;; (starting with a vertical bar), and another rule. + (let ((rule-regexp + (rx (zero-or-more (any " \t")) + "+" + (one-or-more (one-or-more "-") "+") + (zero-or-more (any " \t")) + eol)) + (non-table.el-data-line + (rx bol + (zero-or-more (any " \t")) + (or eol (not (any "| \t"))))) (next (line-beginning-position 2))) (and (looking-at rule-regexp) (save-excursion - (forward-line) - (re-search-forward "^[ \t]*\\($\\|[^|]\\)" limit t) + (end-of-line) + (re-search-forward non-table.el-data-line limit t) (and (> (line-beginning-position) next) (org-match-line rule-regexp)))))) (org-element-table-parser limit affiliated))