diff --git a/CHANGES b/CHANGES index 3a7ebf429..c3be86a31 100644 --- a/CHANGES +++ b/CHANGES @@ -23,6 +23,8 @@ Incompatible changes section * #7996: manpage: Make a section directory on build manpage by default (see :confval:`man_make_section_directory`) +* #7849: html: Change the default setting of + :confval:`html_codeblock_linenos_style` to ``'inline'`` * #8380: html search: search results are wrapped with ``
`` instead of ``
' - ' 1\n' - ' 2\n' - ' 3\n' - ' 4\n' - ' 5\n' - ' 6\n' - ' 7\n' - ' 8\n' - ' 9\n' - '10\n' - '11\n' - '12\n' - '13 | ' in html)
+ assert (' 1'
+ '# Literally included file using Python highlighting' in html)
# :lineno-start:
- assert ('' - '200\n' - '201\n' - '202\n' - '203\n' - '204\n' - '205\n' - '206\n' - '207\n' - '208\n' - '209\n' - '210\n' - '211\n' - '212 | ' in html)
+ assert ('200'
+ '# Literally included file using Python highlighting' in html)
- # :lineno-match:
- assert ('' - '5\n' - '6\n' - '7\n' - '8\n' - '9 | ' in html)
+ # :lines: 5-9
+ assert ('5class '
+ 'Foo:' in html)
@pytest.mark.sphinx('latex', testroot='directive-code')
@@ -594,45 +566,17 @@ def test_linenothreshold(app, status, warning):
app.builder.build(['linenothreshold'])
html = (app.outdir / 'linenothreshold.html').read_text()
- lineos_head = '' - lineos_tail = ' | '
-
# code-block using linenothreshold
- _, matched, html = html.partition(lineos_head +
- '1\n'
- '2\n'
- '3\n'
- '4\n'
- '5\n'
- '6' + lineos_tail)
- assert matched
+ assert ('1class '
+ 'Foo:' in html)
- # code-block not using linenothreshold
- html, matched, _ = html.partition(lineos_head +
- '1\n'
- '2' + lineos_tail)
- assert not matched
+ # code-block not using linenothreshold (no line numbers)
+ assert '# comment' in html
# literal include using linenothreshold
- _, matched, html = html.partition(lineos_head +
- ' 1\n'
- ' 2\n'
- ' 3\n'
- ' 4\n'
- ' 5\n'
- ' 6\n'
- ' 7\n'
- ' 8\n'
- ' 9\n'
- '10\n'
- '11\n'
- '12\n'
- '13' + lineos_tail)
- assert matched
+ assert (' 1'
+ '# Literally included file using Python highlighting' in html)
- # literal include not using linenothreshold
- html, matched, _ = html.partition(lineos_head +
- '1\n'
- '2\n'
- '3' + lineos_tail)
- assert not matched
+ # literal include not using linenothreshold (no line numbers)
+ assert ('# Very small literal include '
+ '(linenothreshold check)' in html)