~lioploum/offpunk

36c9709bc4cf67e51aac8ff7e1e901800cadf249 — Ploum 3 months ago 6ad5902
consider files as XML, not SVG, if no .svg extension
2 files changed, 4 insertions(+), 0 deletions(-)

M CHANGELOG
M ansicat.py
M CHANGELOG => CHANGELOG +1 -0
@@ 15,6 15,7 @@
- opnk: added "--mode" command-line argument (bug #39)
- offpunk: support for "preformatted" theming (bug #38)
- opnk/netcache: added "--cache-validity" command-line argument (bug #37)
- ansicat: consider files as XML, not SVG, if they don’t have .svg extension

## 2.1 - December 15th 2023
- freshly updated gemtext/rss links are highlighted ("new_link" theme option)

M ansicat.py => ansicat.py +3 -0
@@ 1355,6 1355,9 @@ def get_mime(path,url=None):
        # If it’s a xml file, consider it as such, regardless of what file thinks
        elif path.endswith(".xml"):
            mime = "text/xml"
        # If it doesn’t end with .svg, it is probably an xml, not a SVG file
        elif "svg" in mime and not path.endswith(".svg"):
            mime = "text/xml"
        #Some xml/html document are considered as octet-stream
        if mime == "application/octet-stream":
            mime = "text/xml"