HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1017-azure #17~24.04.1-Ubuntu SMP Mon Dec 1 20:10:50 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: //lib/x86_64-linux-gnu/gobject-introspection/giscanner/mdextensions.py
from markdown.extensions import Extension
from markdown.treeprocessors import Treeprocessor


class RemoveOuterP(Treeprocessor):
    def run(self, root):
        if len(root) == 1 and root[0].tag == "p":
            root[0].tag = "span"


class InlineMarkdown(Extension):
    def extendMarkdown(self, md, md_globals):
        md.treeprocessors.add("remove_outer_p", RemoveOuterP(md), "_end")