From cbf6d40c21c6caa6bf951d29bbb3b736e875d27e Mon Sep 17 00:00:00 2001
From: Andrei Gherzan <andrei.gherzan@huawei.com>
Date: Mon, 7 Nov 2022 18:35:49 +0000
Subject: [PATCH] contributing: Fix lua stript

The lua script for filtering out toctrees started to fail with the
latest pandoc with:

./CONTRIBUTING.lua:12: attempt to index a nil value (field 'integer
index')

We fix it by using the classes:includes which is simpler and it works.

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
---
 contributing/CONTRIBUTING.lua | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/contributing/CONTRIBUTING.lua b/contributing/CONTRIBUTING.lua
index 215cff1..79e3724 100644
--- a/contributing/CONTRIBUTING.lua
+++ b/contributing/CONTRIBUTING.lua
@@ -8,9 +8,8 @@
 -- tool. This is needed when converting a set of reST documents to a markdown
 -- one where directives like `toctree` and `contents` are not supported and end
 -- up translated literally.
-function Div(el)
-  local class = el["c"][1][2][1]
-  if class == "toctree" or class == "contents" then
+function Div(div)
+  if div.classes:includes('toctree') or div.classes:includes('contents') then
     return {}
   else
     return nil
-- 
GitLab