Code Duplication    Length = 8-9 lines in 2 locations

pandoc_numbering/_main.py 2 locations

@@ 1099-1107 (lines=9) @@
1096
    defined
1097
        The defined parameter
1098
    """
1099
    if "listing-title" in definition:
1100
        if isinstance(definition["listing-title"], MetaInlines):
1101
            defined[category]["listing-title"] = definition["listing-title"].content
1102
            # Detach from original parent
1103
            defined[category]["listing-title"].parent = None
1104
        else:
1105
            debug(
1106
                "[WARNING] pandoc-numbering: listing-title is not correct for category "
1107
                + category
1108
            )
1109
    for key in ("listing-unnumbered", "listing-unlisted"):
1110
        if key in definition:
@@ 1153-1160 (lines=8) @@
1150
    tag
1151
        The tag parameter
1152
    """
1153
    if tag in definition:
1154
        if isinstance(definition[tag], MetaInlines):
1155
            # Detach from original parent
1156
            defined[category][tag] = definition[tag].content
1157
            defined[category][tag].parent = None
1158
        else:
1159
            debug(
1160
                f"[WARNING] pandoc-numbering: "
1161
                f"{tag} is not correct for category {category}"
1162
            )
1163