src/simplify_docx/elements/body.py [16:37]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def to_json(
        self, doc, options: Dict[str, str] = None, super_iter: Optional[Iterator] = None
    ) -> Dict[str, Any]:
        """
        Coerce a container object to JSON
        """
        contents = []
        iter_me = peekable(self)
        for elt in iter_me:
            JSON = elt.to_json(doc, options, iter_me)

            if (
                JSON["TYPE"] == "CT_P"
                and options.get("ignore-empty-paragraphs", False)
                and not JSON["VALUE"]
            ):
                continue

            contents.append(JSON)

        out: Dict[str, Any] = {"TYPE": self.__type__, "VALUE": contents}
        return out
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/simplify_docx/elements/table.py [18:39]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    def to_json(
        self, doc, options: Dict[str, str] = None, super_iter: Optional[Iterator] = None
    ) -> Dict[str, Any]:
        """
        Coerce a container object to JSON
        """
        contents = []
        iter_me = peekable(self)
        for elt in iter_me:
            JSON = elt.to_json(doc, options, iter_me)

            if (
                JSON["TYPE"] == "CT_P"
                and options.get("ignore-empty-paragraphs", False)
                and not JSON["VALUE"]
            ):
                continue

            contents.append(JSON)

        out: Dict[str, Any] = {"TYPE": self.__type__, "VALUE": contents}
        return out
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



