diff --git a/myst_parser/mdit_to_docutils/base.py b/myst_parser/mdit_to_docutils/base.py index 099b5ad1..252cc353 100644 --- a/myst_parser/mdit_to_docutils/base.py +++ b/myst_parser/mdit_to_docutils/base.py @@ -912,7 +912,7 @@ def render_table(self, token: SyntaxTreeNode) -> None: # column settings element maxcols = len(header_row.children) - colwidths = [round(100 / maxcols, 2)] * maxcols + colwidths = [100 // maxcols] * maxcols tgroup = nodes.tgroup(cols=len(colwidths)) table += tgroup for colwidth in colwidths: diff --git a/tests/test_renderers/fixtures/sphinx_directives.md b/tests/test_renderers/fixtures/sphinx_directives.md index 16a5fa74..2084558e 100644 --- a/tests/test_renderers/fixtures/sphinx_directives.md +++ b/tests/test_renderers/fixtures/sphinx_directives.md @@ -241,8 +241,8 @@ table (`sphinx.directives.patches.RSTTable`): title - - + + diff --git a/tests/test_renderers/fixtures/tables.md b/tests/test_renderers/fixtures/tables.md index f24a86cc..b478b926 100644 --- a/tests/test_renderers/fixtures/tables.md +++ b/tests/test_renderers/fixtures/tables.md @@ -7,8 +7,8 @@ a|b - - + + @@ -35,8 +35,8 @@ Header only:
- - + + @@ -56,9 +56,9 @@ a | b | c
- - - + + + @@ -92,8 +92,8 @@ Nested syntax:
- - + + @@ -125,8 +125,8 @@ a|b
- - + + diff --git a/tests/test_sphinx/sourcedirs/texi_table/conf.py b/tests/test_sphinx/sourcedirs/texi_table/conf.py new file mode 100644 index 00000000..e1c5009b --- /dev/null +++ b/tests/test_sphinx/sourcedirs/texi_table/conf.py @@ -0,0 +1,2 @@ +extensions = ["myst_parser"] +exclude_patterns = ["_build"] diff --git a/tests/test_sphinx/sourcedirs/texi_table/index.md b/tests/test_sphinx/sourcedirs/texi_table/index.md new file mode 100644 index 00000000..9face4b5 --- /dev/null +++ b/tests/test_sphinx/sourcedirs/texi_table/index.md @@ -0,0 +1,3 @@ +| foo | bar | +| --- | --- | +| baz | bim | diff --git a/tests/test_sphinx/test_sphinx_builds.py b/tests/test_sphinx/test_sphinx_builds.py index e8615a64..ca34c733 100644 --- a/tests/test_sphinx/test_sphinx_builds.py +++ b/tests/test_sphinx/test_sphinx_builds.py @@ -547,3 +547,20 @@ def test_fieldlist_extension( regress_html=True, regress_ext=f".sphinx{sphinx.version_info[0]}.html", ) + + +@pytest.mark.sphinx( + buildername="texinfo", + srcdir=os.path.join(SOURCE_DIR, "texi_table"), + freshenv=True, +) +def test_texinfo_table( + app, + status, + warning, +): + """Test that tables can be built with the Texinfo builder.""" + app.build() + assert "build succeeded" in status.getvalue() # Build succeeded + warnings = warning.getvalue().strip() + assert warnings == "" diff --git a/tests/test_sphinx/test_sphinx_builds/test_basic.resolved.sphinx4.xml b/tests/test_sphinx/test_sphinx_builds/test_basic.resolved.sphinx4.xml index ed086997..8a12765e 100644 --- a/tests/test_sphinx/test_sphinx_builds/test_basic.resolved.sphinx4.xml +++ b/tests/test_sphinx/test_sphinx_builds/test_basic.resolved.sphinx4.xml @@ -75,8 +75,8 @@ a=1{`}
- - + + diff --git a/tests/test_sphinx/test_sphinx_builds/test_basic.sphinx4.xml b/tests/test_sphinx/test_sphinx_builds/test_basic.sphinx4.xml index c793d318..34b0e3c3 100644 --- a/tests/test_sphinx/test_sphinx_builds/test_basic.sphinx4.xml +++ b/tests/test_sphinx/test_sphinx_builds/test_basic.sphinx4.xml @@ -76,8 +76,8 @@ a=1{`}
- - + + diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx4.xml b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx4.xml index 1b1c195b..231ca337 100644 --- a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx4.xml +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx4.xml @@ -43,7 +43,7 @@ gras
- + diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.xml b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.xml index 0d8dbc79..dfc5f414 100644 --- a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.xml +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.xml @@ -43,7 +43,7 @@ gras
- +