Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code-block: Fix handling of :dedent: and add unit tests #9661

Merged
merged 8 commits into from
Jan 15, 2022

Commits on Sep 21, 2021

  1. Configuration menu
    Copy the full SHA
    cf9b5b5 View commit details
    Browse the repository at this point in the history
  2. code-block: Handle 0 as numeric argument in :dedent:

    Due to how Python converts ints to bool the numeric argument ``0`` to
    the :dedent: option of the code-block directive was handled like if no
    argument was given to :dedent:.
    
    Check properly for None in the options argument processing, so ``0`` is
    treated as numeric argument to :dedent:.
    
    Bug: sphinx-doc#9636
    latosha-maltba committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    3b46553 View commit details
    Browse the repository at this point in the history
  3. Fix: 9636: code-block: Do not remove newlines with :dedent:

    If the option :dedent: (without numeric argument) was given to
    code-block then all newlines where striped from the resulting code.
    Preserve newlines when stripping common whitespace at the beginning of
    code blocks.
    latosha-maltba committed Sep 21, 2021
    Configuration menu
    Copy the full SHA
    3b9ecf9 View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2021

  1. Update :dedent: example

    The presence or absence of the ``:dedent: 4`` option in the example
    
    .. code-block:: ruby
       :dedent: 4
    
           some ruby code
    
    makes no difference for the output due to how ReST handles whitespace.
    If it is present, then ReST indent is 3 and the 4 spaces of the code are
    stripped by the :dedent: option.  If the dedent option is missing, then
    the ReST indent is 7 and all whitespace is stripped again.
    
    Add a dummy option to fixate the ReST indent to 3, so adding and
    removing of the option in the example has an effect on the output.
    latosha-maltba committed Sep 23, 2021
    Configuration menu
    Copy the full SHA
    54b1991 View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2022

  1. Merge branch '4.x' into HEAD

    tk0miya committed Jan 15, 2022
    Configuration menu
    Copy the full SHA
    6611140 View commit details
    Browse the repository at this point in the history
  2. doc: Remove a mention to :dedent: 0

    `:dedent: 0` option for the code-block directive is a secret feature.
    So it should not be mentioned in our docs.
    tk0miya committed Jan 15, 2022
    Configuration menu
    Copy the full SHA
    44e6d0c View commit details
    Browse the repository at this point in the history
  3. Fix a flake8 warning

    tk0miya committed Jan 15, 2022
    Configuration menu
    Copy the full SHA
    e2f1416 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ff54f97 View commit details
    Browse the repository at this point in the history