mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Jonathan Corbet <corbet@lwn.net>,
	Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-kernel@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: [PATCH 06/10] docs: kdoc_output: fix handling of simple tables
Date: Mon, 23 Mar 2026 10:10:49 +0100	[thread overview]
Message-ID: <dea95337c05040f95e5a95ae41d69ddef0aaa8d6.1774256269.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1774256269.git.mchehab+huawei@kernel.org>

Fix check for simple table delimiters.

ReST simple tables use "=" instead of "-". I ended testing it with
a table modified from a complex one, using "--- --- ---", instead
of searching for a real Kernel example.

Only noticed when adding an unit test and seek for an actual
example from kernel-doc markups.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 tools/lib/python/kdoc/kdoc_output.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/lib/python/kdoc/kdoc_output.py b/tools/lib/python/kdoc/kdoc_output.py
index 1b54117dbe19..2bfcd356654b 100644
--- a/tools/lib/python/kdoc/kdoc_output.py
+++ b/tools/lib/python/kdoc/kdoc_output.py
@@ -846,14 +846,14 @@ class ManFormat(OutputFormat):
         colspec_row = None
 
         pos = []
-        for m in KernRe(r'\-+').finditer(lines[i]):
+        for m in KernRe(r'\=+').finditer(lines[i]):
             pos.append((m.start(), m.end() - 1))
 
         i += 1
         while i < len(lines):
             line = lines[i]
 
-            if KernRe(r"^\s*[\-]+[ \t\-]+$").match(line):
+            if KernRe(r"^\s*[\=]+[ \t\=]+$").match(line):
                 i += 1
                 break
 
@@ -969,7 +969,7 @@ class ManFormat(OutputFormat):
                     self.data += text
                     continue
 
-                if KernRe(r"^\-+[ \t]\-[ \t\-]+$").match(line):
+                if KernRe(r"^\=+[ \t]\=[ \t\=]+$").match(line):
                     i, text = self.simple_table(lines, i)
                     self.data += text
                     continue
-- 
2.53.0


  parent reply	other threads:[~2026-03-23  9:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23  9:10 [PATCH 00/10] minor changes at kernel-doc and a fix Mauro Carvalho Chehab
2026-03-23  9:10 ` [PATCH 01/10] MAINTAINERS: update documentation scripts to add unittests Mauro Carvalho Chehab
2026-03-23  9:10 ` [PATCH 02/10] unittests: test_kdoc_parser: add command line arg to read a YAML file Mauro Carvalho Chehab
2026-03-23  9:10 ` [PATCH 03/10] docs: tools: include kdoc_yaml_file at documentation Mauro Carvalho Chehab
2026-03-23  9:10 ` [PATCH 04/10] docs: kdoc_yaml_file: add a representer to make strings look nicer Mauro Carvalho Chehab
2026-03-23  9:10 ` [PATCH 05/10] docs: kdoc-test.yaml: add more tests Mauro Carvalho Chehab
2026-03-23  9:10 ` Mauro Carvalho Chehab [this message]
2026-03-23  9:10 ` [PATCH 07/10] docs: kdoc: better handle source when producing YAML output Mauro Carvalho Chehab
2026-03-23 11:15   ` Loktionov, Aleksandr
2026-03-23  9:10 ` [PATCH 08/10] docs: kdoc_yaml_file: use a better name for the tests Mauro Carvalho Chehab
2026-03-23  9:10 ` [PATCH 09/10] docs: kdoc_output: raise an error if full_proto not available for var Mauro Carvalho Chehab
2026-03-23  9:10 ` [PATCH 10/10] docs: c_lex.py: store logger on its data Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dea95337c05040f95e5a95ae41d69ddef0aaa8d6.1774256269.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®