Skip to content

[BUG] remove admonitions for pdf formatting #2275

@bclenet

Description

@bclenet

Problem

There is a BUG when:

  1. no blank line is inserted after the header of an admonition
    AND
  2. the admonition consists in codeblock containing a pair of brackets that opens on a line and closes on the next ones. (e.g.: a list of JSON metadata).

The python code that removes admonitions formatting for pdf rendering ignores the first line of the admonition content (cf. pdf_build_src/remove_admonitions.py#L41). In this case, this is the beginning of the code block, e.g. ```JSON.

Later, the python code responsible for multi-line markdown links checking (cf. pdf_build_src/process_markdowns.py#L230) -which is supposed to ignore code blocks- interprets the multi-line JSON list as a multi-line link because the header for the code block was removed.

Expected

I would expect that it's allowed to have a codeblock inside a admonition, and no blank line after the header.
I also suppose that this first line removal can remove contents from the spec during the pdf export...

Solution

I'm not sure whether lines 41 to 44 inside pdf_build_src/remove_admonitions.py are really needed for another reason.
If not, I can propose a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions