summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Abou Samra <jean@abou-samra.fr>2023-03-30 15:42:45 +0200
committerJean Abou Samra <jean@abou-samra.fr>2023-03-30 15:42:45 +0200
commit9f152a665af23e865e822121d8d35399523f9ea4 (patch)
tree7ce5b496a37795d899d079abdeb195c05a3ac103
parent36c34ae6b0daf577f6722822af0d0e13b0889f52 (diff)
downloadpygments-git-9f152a665af23e865e822121d8d35399523f9ea4.tar.gz
Slightly clarify documentation of HtmlFormatter nowrap option
Fixes #2396
-rw-r--r--pygments/formatters/html.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/pygments/formatters/html.py b/pygments/formatters/html.py
index 44b15c52..4596dcdd 100644
--- a/pygments/formatters/html.py
+++ b/pygments/formatters/html.py
@@ -112,9 +112,9 @@ DOC_FOOTER = '''\
class HtmlFormatter(Formatter):
r"""
- Format tokens as HTML 4 ``<span>`` tags within a ``<pre>`` tag, wrapped
- in a ``<div>`` tag. The ``<div>``'s CSS class can be set by the `cssclass`
- option.
+ Format tokens as HTML 4 ``<span>`` tags. By default, the content is enclosed
+ in a ``<pre>`` tag, itself wrapped in a ``<div>`` tag (but see the `nowrap` option).
+ The ``<div>``'s CSS class can be set by the `cssclass` option.
If the `linenos` option is set to ``"table"``, the ``<pre>`` is
additionally wrapped inside a ``<table>`` which has one row and two
@@ -140,8 +140,6 @@ class HtmlFormatter(Formatter):
(whitespace added to improve clarity).
- Wrapping can be disabled using the `nowrap` option.
-
A list of lines can be specified using the `hl_lines` option to make these
lines highlighted (as of Pygments 0.11).
@@ -187,8 +185,8 @@ class HtmlFormatter(Formatter):
Additional options accepted:
`nowrap`
- If set to ``True``, don't wrap the tokens at all, not even inside a ``<pre>``
- tag. This disables most other options (default: ``False``).
+ If set to ``True``, don't add a ``<pre>`` and a ``<div>`` tag
+ around the tokens. This disables most other options (default: ``False``).
`full`
Tells the formatter to output a "full" document, i.e. a complete